问题
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.
回答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
来源:https://stackoverflow.com/questions/50602446/progress-sax-reader