-1

Here is my 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>

I am having a lot of trouble getting the attribute "differ:id" for the node "WebContent"

It seems like it doesn't like the colon in the attribute name. Any Ideas?

user1435853
  • 633
  • 2
  • 8
  • 18

2 Answers2

0

the attribute is "diffgr:id" not "differ:id" maybe this is your issue

Slavi Galabov
  • 96
  • 1
  • 1
  • 5
0

Try this:

$xml->WebContent->attributes("diffgr",TRUE)->id;
// TRUE means that `diffgr` is a prefix of the attribute

COuld be found here -> https://stackoverflow.com/a/15546669/2040840