i'm trying to take some information from xml data created with mxgraph.
example of the xml.
Code: Select all
<mxGraphModel>
<root>
<mxCell id="5"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="login" parent="1" vertex="1">
<mxGeometry x="90" y="100" width="80" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>Code: Select all
for ($i=0;$i<3;$i++){
foreach($xml->mxCell[$i]->attributes() as $a => $b)
{
echo $a."=",$b." ";
}
echo "<br>";
}Code: Select all
Fatal error: Call to a member function attributes() on a non-object in C:\AppServ\www\xml.php on line 6Code: Select all
id=5
id=1 parent=0
id=2 value=login parent=1 vertex=1thanks,
Ricardo Lopes