So I'm trying to use SimpleXML to get some attribute information about
some nodes in my XML document, but it seems like SimpleXML ignores
attributes for elements with no children,
For instance:
<xmlfile>
<object foo="bar">
<color mode="rgb">ffdd ee</color>
</object>
</xmlfile>
I can get the attribute foo from the object element, but there does
not seem to be any way to retrieve the mode attrbitue from the color
element. print_r() of this data shows that mode="rgb" is totally
lost.
If this is a bug, I'll go report this to php.net, but if it's not,
could someone explain either the reasoning behind it or how to get
this information?
some nodes in my XML document, but it seems like SimpleXML ignores
attributes for elements with no children,
For instance:
<xmlfile>
<object foo="bar">
<color mode="rgb">ffdd ee</color>
</object>
</xmlfile>
I can get the attribute foo from the object element, but there does
not seem to be any way to retrieve the mode attrbitue from the color
element. print_r() of this data shows that mode="rgb" is totally
lost.
If this is a bug, I'll go report this to php.net, but if it's not,
could someone explain either the reasoning behind it or how to get
this information?
Comment