All Projects → zeux → Pugixml

zeux / Pugixml

Licence: mit
Light-weight, simple and fast XML parser for C++ with XPath support

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
powershell
5483 projects
Makefile
30231 projects
lua
6591 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pugixml

Didom
Simple and fast HTML and XML parser
Stars: ✭ 1,939 (-30.97%)
Mutual labels:  xml-parser, dom, xml, xpath
go-xmldom
XML DOM processing for Golang, supports xpath query
Stars: ✭ 38 (-98.65%)
Mutual labels:  dom, xpath, xml-parser
Fluentdom
A fluent api for working with XML in PHP
Stars: ✭ 327 (-88.36%)
Mutual labels:  xml, xpath, dom
fox
A Fortran XML library
Stars: ✭ 51 (-98.18%)
Mutual labels:  dom, xml, xml-parser
Jsoup
jsoup: the Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety.
Stars: ✭ 9,184 (+226.95%)
Mutual labels:  dom, xml, xpath
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (-84.41%)
Mutual labels:  xml, xpath, xml-parser
Fuzi
A fast & lightweight XML & HTML parser in Swift with XPath & CSS support
Stars: ✭ 894 (-68.17%)
Mutual labels:  xml, xpath, xml-parser
Jquery Xpath
jQuery XPath plugin (with full XPath 2.0 language support)
Stars: ✭ 173 (-93.84%)
Mutual labels:  xml, xpath, dom
Xml
XML without worries
Stars: ✭ 35 (-98.75%)
Mutual labels:  xml, xpath, dom
Xmlquery
xmlquery is Golang XPath package for XML query.
Stars: ✭ 209 (-92.56%)
Mutual labels:  xml, xpath, xml-parser
Binding.scala
Reactive data-binding for Scala
Stars: ✭ 1,539 (-45.21%)
Mutual labels:  xml, dom
Graphquery
GraphQuery is a query language and execution engine tied to any backend service.
Stars: ✭ 112 (-96.01%)
Mutual labels:  xml, xpath
Markup
A Swift package for working with HTML, XML, and other markup languages, based on libxml2.
Stars: ✭ 93 (-96.69%)
Mutual labels:  xml, xpath
Sax Wasm
The first streamable, fixed memory XML, HTML, and JSX parser for WebAssembly.
Stars: ✭ 89 (-96.83%)
Mutual labels:  xml, xml-parser
Xmlbuilder2
An XML builder for node.js
Stars: ✭ 143 (-94.91%)
Mutual labels:  xml, xml-parser
Dart Xml
Lightweight library for parsing, traversing, and transforming XML in Dart.
Stars: ✭ 139 (-95.05%)
Mutual labels:  xml, xml-parser
Woodstox
The gold standard Stax XML API implementation. Now at Github.
Stars: ✭ 145 (-94.84%)
Mutual labels:  xml, xml-parser
Domquery
PHP library for easy 'jQuery like' DOM traversing and manipulation.
Stars: ✭ 84 (-97.01%)
Mutual labels:  xpath, dom
Xml2lua
XML Parser written entirely in Lua that works for Lua 5.1+. Convert XML to and from Lua Tables 🌖💱
Stars: ✭ 150 (-94.66%)
Mutual labels:  xml, xml-parser
Phpstamp
The XSL-way templating library for MS Office Word DOCX documents.
Stars: ✭ 150 (-94.66%)
Mutual labels:  xml, dom

pugixml Actions Status Build status codecov.io MIT

pugixml is a C++ XML processing library, which consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 implementation for complex data-driven tree queries. Full Unicode support is also available, with Unicode interface variants and conversions between different Unicode encodings (which happen automatically during parsing/saving).

pugixml is used by a lot of projects, both open-source and proprietary, for performance and easy-to-use interface.

Documentation

Documentation for the current release of pugixml is available on-line as two separate documents:

You’re advised to start with the quick-start guide; however, many important library features are either not described in it at all or only mentioned briefly; if you require more information you should read the complete manual.

Example

Here's an example of how code using pugixml looks; it opens an XML file, goes over all Tool nodes and prints tools that have a Timeout attribute greater than 0:

#include "pugixml.hpp"
#include <iostream>

int main()
{
    pugi::xml_document doc;
    pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
    if (!result)
        return -1;
        
    for (pugi::xml_node tool: doc.child("Profile").child("Tools").children("Tool"))
    {
        int timeout = tool.attribute("Timeout").as_int();
        
        if (timeout > 0)
            std::cout << "Tool " << tool.attribute("Filename").value() << " has timeout " << timeout << "\n";
    }
}

And the same example using XPath:

#include "pugixml.hpp"
#include <iostream>

int main()
{
    pugi::xml_document doc;
    pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
    if (!result)
        return -1;
        
    pugi::xpath_node_set tools_with_timeout = doc.select_nodes("/Profile/Tools/Tool[@Timeout > 0]");
    
    for (pugi::xpath_node node: tools_with_timeout)
    {
        pugi::xml_node tool = node.node();
        std::cout << "Tool " << tool.attribute("Filename").value() <<
            " has timeout " << tool.attribute("Timeout").as_int() << "\n";
    }
}

License

This library is available to anybody free of charge, under the terms of MIT License (see LICENSE.md).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].