I am trying to read through an REA-XML file and using simplexml to convert the xml into an array
$xml = simplexml_load_string($data) or die("Error: Cannot create object");
There is a section in the XML that looks like this:
<images>
<img id="a" modTime="2009-01-01-12:30:00" url="http://image.jpg" format="jpg"/>
<img id="m" modTime="2009-01-01-12:30:00" url="https://image.jpg" format="jpg"/>
</images>
When converted to an array , an additional array element "@attributes" is created with the modTime etc in it.
However, in the same XML , same level:
<landDetails>
<area unit="square">80</area>
<frontage unit="meter">20</frontage>
<depth unit="meter" side="rear">40</depth>
<crossOver value="left"/>
</landDetails>
The "unit" attribute is missing completely, The value for "value" in the crossOver, is in an "@attributes" array, but the three other items for "unit" are missing completely from the var_dump
Why do the unit values not show up in the @attribute array, or anywhere else in the landDetails section?
full example XML: