17 int ScanNode(TXMLEngine &xml, XMLNodePointer_t node)
20 XMLNodePointer_t child = xml.GetChild(node);
24 int numsub = ScanNode(xml, child);
27 XMLNodePointer_t info = xml.NewChild(node, xml.GetNS(child),
"info");
30 xml.NewAttr(info, 0,
"name", xml.GetNodeName(child));
31 if (numsub > 0) xml.NewIntAttr(info,
"num", numsub);
34 xml.AddChildAfter(node, info, child);
39 xml.ShiftToNext(child);
44 void xmlmodifyfile(
const char* filename =
"example.xml")
50 XMLDocPointer_t xmldoc = xml.ParseFile(filename);
53 ScanNode(xml, xml.DocGetRootElement(xmldoc));
56 xml.SaveDoc(xmldoc,
"modify.xml");