/yazi-xml

a tiny c++ xml parser

Primary LanguageC++MIT LicenseMIT

yazi-xml

a tiny c++ xml parser

example

#include <iostream>
using namespace std;

#include <xml/Xml.h>
using namespace yazi::xml;

int main()
{
    Xml root;
    root.load("./test.xml");

    const string & name = root["student"]["name"].text();
    int id = root["student"].attr("id");
    const string & age = root["student"]["age"].text();
    for (Xml::iterator it = root.begin(); it != root.end(); it++)
    {
        std::cout << *it << std::endl;
    }

    return 0;
}