Progress Sax-reader

只谈情不闲聊 提交于 2019-12-25 01:34:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!