0

I'm new to the progress Sax-reader. I'm reading an XML and I'm trying to get the value of one of the attributes in a node. Specifically the place-id attribute value.

<address ssid="32975" place-id="11537" quality="good">

I'm reading the documentation here: https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvxml%2Fretrieving-data-from-a-sax-attributes-object.html%23wwID0ECILM and to me that seems to indicate I should be using

GET-VALUE-BY-NAMESPACE-NAME( ) 

I've written it like this in a CASE:, but haven't been able to get it to work, and can't find any examples:

WHEN "address" THEN ASSIGN lv-place-id = charData.GET-VALUE-BY-NAMESPACE-NAME('address','place-id'). 

Any help appreciated.

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
Stephen Kennedy
  • 529
  • 5
  • 18

1 Answers1

1

It has been a while since I coded anything with the SAX reader but my old code suggests that you probably want something along these lines in your StartElement() procedure:

placeId = hAttributes:get-value-by-qname( "place-id" ).

Depending on what you are actually doing you may need to additional code to decide when to execute that (I'm guessing your CASE statement suits that purpose).

This sample code might also be useful:

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvxml%2Fwithout-namespace-processing.html%23wwID0EFNAO

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
  • Hi Tom, Thanks for the response. That is how I have it in my program currently, I'll also take a look at the Example. Much appreciated. – Stephen Kennedy Jun 08 '18 at 08:00