Hi to all,
i have some painful problems with PHP and XML and I guess I'm not the only one. I would like to append 1 xml file to another xml file.
Example:
file1.xml
<FDRML>
<image>
<algorithm_results>
</algorithm_results>
</image>
</FDRML>
file2.xml
<Algorithm>
<some_nodes></some_nodes>
...
</Algorithm>
I am using ActiveLink PHP XML, which is suppost to be cross platfrom compliant, and easy to use... It is but I still dont know how to append file2.xml to file1.xml.
I found a sollution but this only appends file2.xml to the end of the file1.xml.
$xmldoc1 = new XMLDocument("file1.xml");
$xmldoc2 = new XMLDocument("file2.xml");
$myXML1 = &$xmldoc1->getXML();
$myXML2 = &$xmldoc2->getXML();
$myXML1->addXMLAsBranch($myXML2);
I would like to appned file2.xml to a node in file1.xml (FDRML/Image/algorithm_results). Any ideas to how to do it?
Thanks,
Primoz