Skip to content

XML Parser

Jaysmito Mukherjee edited this page Nov 9, 2021 · 1 revision

Include

#include "lexpp.h"
#include "extensions/xml_parser.h"

Creating a Parser

std::shared_ptr<lexpp::XMLParser> parser = std::make_shared<lexpp::XMLParser>(data);

Parsing the data

lexpp::lex(parser);

Displaying the Result

std::cout << parser->get_root_node();

Structs

struct XMLDocumentNode{
    std::string name = "";
    std::string value = "";
    std::vector<XMLDocumentNode*> children;
    std::vector<std::pair<std::string, std::string>> attributes;
};
Clone this wiki locally