You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Progress Sax-reader获取XML节点place-id属性值问题求助

Fixing Progress SAX-Reader Attribute Retrieval for place-id

Hey there! Let's get your SAX reader code working to pull that place-id attribute value.

First, let's break down why your current code isn't working: the GET-VALUE-BY-NAMESPACE-NAME() method is designed specifically for attributes that belong to an XML namespace. Looking at your target node:

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

None of these attributes are tied to a namespace (there's no xmlns: prefix or namespace declaration associated with them), so this method isn't the right tool for the job.

Correct Code Approach

Instead, use the GET-VALUE() method, which is built to retrieve attribute values that don't use namespaces. Here's how to adjust your CASE statement:

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

A Quick Note on Namespaces (For Future Reference)

If you ever encounter attributes with a namespace (e.g., <address xmlns:loc="http://example.com/locations" loc:place-id="11537">), that's when you'd reach for GET-VALUE-BY-NAMESPACE-NAME(). In that scenario, you'd pass the namespace URI first, then the attribute's local name:

ASSIGN lv-place-id = charData.GET-VALUE-BY-NAMESPACE-NAME('http://example.com/locations', 'place-id').

This should resolve your current issue and get you pulling that place-id value successfully!

内容的提问来源于stack exchange,提问作者Stephen Kennedy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:09:21