pugixml parses XML into a traversable DOM, supports XPath 1.0 queries, and handles Unicode encodings for C++ applications.
Overview
pugixml is a C++ library for loading, parsing, and modifying XML. It offers a DOM-like tree you can walk and edit, a fast non-validating parser that builds that tree from files or memory buffers, and an XPath 1.0 implementation for expressive queries over the document.
Unicode is supported through interface variants and automatic conversions between encodings during parse and save operations. The API is documented in a quick-start guide and a full reference manual, with code examples for iteration and XPath selection.
The library is distributed under the MIT license and is packaged for many Linux distributions, BSD systems, macOS package managers, and NuGet or Conda among other channels. It is intended to be embedded directly in applications that need XML processing without a separate runtime service.
Typical usage loads a document, locates nodes by structure or XPath, and reads or updates attributes and text. Attribution in user-facing documentation is requested when the library is incorporated into shipped products.
Key features
- DOM-style tree traversal and edits
- Fast non-validating XML parser
- XPath 1.0 query support
- Unicode encoding conversions
- MIT-licensed for embeded use
- Online quick-start and reference docs
- Wide OS package availability
Use cases
- Parsing configuration XML in C++
- XPath-based data extraction
- In-process XML transformation
- Embedded XML in desktop or server apps