PHP call all XML nodes objects without mentioning child node name

pucca

New Member
\[code\]<Node name="node1"> <x x="x"/> <x x="xxx"/></Node><Node name="node2"> <x x="xx"/> <x x="xxxx"/></Node>\[/code\]Okay, this is an XML sample:I call its content using simplexml_load_fileand if i wanna call a specific node content it should be :\[code\]$xml = simplexml_load_file('file.xml');$contents = $xml->node1\[/code\]and to call node object\[code\]$contents = $xml->node1->x\[/code\]Seems fine till now,the question is,how to call object "x" without mentioning node nameyou noticed the sample i added above it has 2 nodes to call x from it i should mention nodename then xi want to call all "x" from the whole XMLhow is it possible?
 
Back
Top