下面是我的XML:
<WebContent diffgr:id="WebContent1" msdata:rowOrder="0">
<orig_inv_no>73</orig_inv_no>
<inv_no>141</inv_no>
<inv_type>S</inv_type>
<content_type>3</content_type>
<content_type_desc>Test</content_type_desc>
<content_value>Sample content</content_value>
</WebContent>
<WebContent diffgr:id="WebContent2" msdata:rowOrder="0">
<orig_inv_no>73</orig_inv_no>
<inv_no>141</inv_no>
<inv_type>S</inv_type>
<content_type>3</content_type>
<content_type_desc>Test</content_type_desc>
<content_value>Sample content</content_value>
</WebContent>
我在获取节点"WebContent“的"differ:id”属性时遇到了很多问题。
它看起来不像属性名称中的冒号。有什么想法吗?
发布于 2018-06-20 04:08:17
属性是"diffgr:id“而不是"differ:id”也许这就是你的问题
发布于 2018-06-20 04:44:04
试试这个:
$xml->WebContent->attributes("diffgr",TRUE)->id;
// TRUE means that `diffgr` is a prefix of the attribute
COuld可在-> https://stackoverflow.com/a/15546669/2040840此处找到
https://stackoverflow.com/questions/50935921
复制相似问题