pyuppsala documentation¶
pyuppsala is a Python binding for the Uppsala XML library – a zero-dependency, pure-Rust implementation of XML 1.0, Namespaces, XPath 1.0, and XSD validation.
Features¶
XML 1.0 parsing with namespace support and encoding detection (UTF-8/UTF-16)
DOM with tree traversal, mutation, and serialization
Source tracking – access original source text and byte ranges for any node
XPath 1.0 evaluation (node-sets, strings, numbers, booleans)
XSD 1.1 validation with 44+ built-in types, facets, identity constraints
XSD regex pattern matching
XmlWriter for imperative XML construction
SIMD-accelerated parsing on x86_64
Zero Python dependencies – ships as a single native extension
Contents
- Quick start
- API reference
- Exceptions
- Examples
- Parse, query, modify
- Namespace-aware processing
- Schema validation with detailed errors
- Building XML with XmlWriter
- XSD regex patterns
- Streaming serialization
- Fast text extraction with element_text
- Source tracking for error reporting
- Namespace-aware child search
- Element name matching
- Building a document from scratch
- XPath context nodes
- Combining XmlWriter with validation
- Tree manipulation: reorder children
- Node iteration patterns