#include#include "XML_Node.h" int main() { XML_Node doc("book"); doc.addChild("title", "The Catcher in the Rye"); doc.addChild("author", "J.D. Salinger"); std::cout << doc.toString() << std::endl; return 0; }
#includeThis example demonstrates how to parse an existing XML string using the XML_Node constructor that takes a string parameter. The `getFirstChild()` method is called to retrieve the first child element with the specified name, and the `getValue()` method is called to retrieve its value. The value is then output to the console.#include "XML_Node.h" int main() { std::string xml = " "; XML_Node doc(xml); std::string author = doc.getFirstChild("author").getValue(); std::cout << "Author: " << author << std::endl; return 0; } The Catcher in the Rye J.D. Salinger