Parse a configuration XML file in a C++ application and read or update its settings at runtime.
Run XPath queries to extract specific elements from a large XML document without writing manual tree-traversal loops.
Load, modify, and save an XML document in a performance-critical C++ game or server application.
pugixml is a C++ library for reading and working with XML files. XML is a text format used to store structured data, and pugixml gives C++ programs a fast and convenient way to load XML files, navigate their contents, modify them, and save them back out. The library reads an XML file and builds a tree structure in memory that represents the document's hierarchy. You can then walk through that tree, find specific elements, read their attributes, change values, or add new content. The interface is designed to be straightforward: you load a document, then traverse it using familiar patterns like looping over child nodes and checking attribute values. For more advanced queries, pugixml includes support for XPath 1.0, a query language designed specifically for selecting parts of an XML document. Instead of writing a loop to find matching nodes, you write a short XPath expression and the library returns the matching set. Both approaches are shown in the README with small code examples. Speed is one of the library's main selling points. Its XML parser is described as extremely fast, and the library is used in a large number of both open-source and commercial projects where performance with XML data matters. Unicode is fully supported, with automatic conversion between different encoding formats during parsing and saving. The library is released under the MIT license, so it can be used freely in commercial and personal projects. Documentation is available as a quick-start guide for getting up and running quickly, and a full reference manual covering every feature in detail. The project has an active test suite and builds are verified automatically on multiple platforms.
← zeux on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.