1 /*******************************************************
2 * Unit test for the xml_node class
5 ******************************************************
16 const char xml_file[] = "xml_test01.xml";
18 std::cout << "Reading XML file " << xml_file << "\n";
20 doc.ParseFile("xml_test01.xml");
22 xml_node root_node(doc);
24 std::cout << "Root element is " << root_node.name() << "\n";
25 std::cout << "Root node type is " << root_node.type() << "\n";
26 assert(root_node.name() == "doc");
31 root_node = root_node[1]; // The book element
33 for (i = 0; child.is_a_node(); i++)
36 std::cout << "Node " << i << " type is " << child.type() << "\n";
37 std::cout << "Node " << i << " name is " << child.name() << "\n";