How do i get all the “seat” child nodes and their attributes from this XML file?
<seatmap id="1">
<seat row="A" seatnum="01" available="1" />
<seat row="A" seatnum="02" available="1" />
<seat row="A" seatnum="03" available="1" />
<seat row="A" seatnum="04" available="1" />
<seat row="A" seatnum="05" available="1" />
</seatmap>
I have different seatmaps, so i want to get them by querying with an ID
then assigning all the ‘seat’ nodes and their attributes to variables.
I’ve been using DOM methods so far, but maybe simpleXML or XPath would be easier as its really
confusing as you drill down from DOMDocumet, DOMElement, DOMNode.
Any help would be great, cheers!
1 Answer