Hi There, I am quite new to simpleXML and I would like to know how I can access child nodes by index singe I do not have the node name
The XML would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<SubRoot>
<Content ItemType="ItemType1">
<ItemDetails>
<ItemDetail>
<City Code="CPT"><![CDATA[Cape Town]]>
</City>
<Item Code="000000000001"><![CDATA[Random Text here]]>
</Item>
<ItemInformation>
<Segment1>
<Segmentchild1 Code="H"><![CDATA[XXXXXX]]>
</Segmentchild1>
**<UNKNOWNNODE Code="CPT"><![CDATA[XXXXXXXX]]>
</UNKNOWNNODE>**
</Segment1>
<Segment2>
<Segmentchild1 Code="A"><![CDATA[XXXXXX]]>
</Segmentchild1>
**<UNKNOWNNODE Code="CPT"><![CDATA[XXXXXXXX]]>
</UNKNOWNNODE>**
</Segment2>
<ItemInformation>
</ItemDetail>
</ItemDetails>
</Content>
</SubRoot>
</Root>
How can i access the UNKNOWNNODE nodes value and attributes?
I access the nodes like this:$transferDetails = $xmlResponse->SubRoot->Content->ItemDetails->children();