进度萨克斯阅读器 [英] Progress Sax-reader

查看:99
本文介绍了进度萨克斯阅读器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sax阅读器是我的新手.我正在读取XML,并试图获取节点中属性之一的值.特别是place-id属性值.

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( ) 

我在CASE中编写了这样的代码:,但未能使其正常工作,并且找不到任何示例:

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'). 

任何帮助表示赞赏.

推荐答案

自从我使用SAX阅读器对任何内容进行编码以来已有一段时间,但是我的旧代码建议您可能需要在StartElement()过程中遵循以下内容:

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" ).

根据您的实际操作,可能需要其他代码来决定何时执行该操作(我猜您的CASE语句适合该目的).

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

这篇关于进度萨克斯阅读器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆