Example to read and parse any xml file, supported by TXMLEngine class The input file, produced by xmlnewfile.C macro is used If you need full xml syntax support, use TXMLParser instead.
Processing /builddir/build/BUILD/root-6.10.00/tutorials/xml/xmlreadfile.C...
void xmlreadfile(const char* filename = "example.xml")
{
if (xmldoc==0) {
delete xml;
return;
}
DisplayNode(xml, mainnode, 1);
delete xml;
}
{
printf(
"%*c node: %s\n",level,
' ', xml->
GetNodeName(node));
if (ns!=0)
while (attr!=0) {
}
if (content!=0)
printf("%*c cont: %s\n",level+2,' ', content);
while (child!=0) {
DisplayNode(xml, child, level+2);
}
}
- Author
- Sergey Linev
Definition in file xmlreadfile.C.