Forum Moderators: coopster
I'm accessing this XML output from a different page but something is going wrong and the page isn't reading the XML properly (although it loads with no errors).
The strange thing is that it works if the XML contains multiple items but not if it only contains one
The basic structure is like this...
<container>
<item attr="val">
<info>some info</info>
</item>
<container>
and for multiple items (which works)
<container>
<item attr="val">
<info>some info</info>
</item>
<item attr="val">
<info>some info</info>
</item>
<container>
I'm using this kind of iteration and I have used this on normal xml file with one item and it worked fine.
$xml = $xmlRelease->getElementsByTagName('container');
foreach ($xml as $track) {
$items = $track->getElementsByTagName('item');
foreach ($items as $info) {
}
}