Hello .
I have just started to use DOM parser. I develop PHP scripts on Windows machine , and then upload them to Linux . May be , this bug is only Windows-specific . So , XML file is :
<?xml version="1.0"?>
<root>
<table name="Users">
<field name="Id" primarykey="True"/>
<field name="Name"/>
</table>
<table name="Orders">
<field name="Id" primarykey="True"/>
<field name="User_id" />
</table>
</root>
In php , I get a reference to root and nodes of first level :
if (!($Def=xmldocfile("Test.xml")))
die("File parse error : test.xml") ;
$root = $Def->root() ;
$tables = $root->children() ;
Then I try to list nodes of first level . I expect to see two lines "Child name = table":
for ($i=0 ; $i<count($root->children() ) ; $i++ )
{ $table=$tables[$i] ;
echo("Child name=".$table->name . "<BR>") ;
}
But the result is :
Child name = text
Child name = table
Child name = text
Child name = table
Child name = text
What is wrong? Thank You.