This crate provides a push based XML parser library that adheres to XML5 specification. In other words this library trades well-formedness for error recovery.
The idea behind this, was to minimize number of errors from
tools that generate XML (e.g.
S won't just return
as text, but will parse it into
You can check out full specification here.
What this library provides is a solid XML parser that can:
- Parse somewhat erroneous XML input
- Provide support for Numeric character references.
- Provide partial XML namespace support.
- Provide full set of SVG/MathML entities
What isn't in scope for this library:
- Document Type Definition parsing - this is pretty hard to do right and nowadays, its used
Data that is known at compile-time and hard-coded into the binary.
Types for tag and attribute names, and tree-builder functionality.
Traits for serializing elements. The serializer expects the data to be xml-like (with a name, and optional children, attrs, text, comments, doctypes, and processing instructions). It uses the visitor pattern, where the serializer and the serializable objects are decoupled and implement their own traits.
Serializer for XML5.
This module contains a single struct
XML5 tokenizer - converts input into tokens
XML5 tree builder - converts tokens into a tree like structure
Helper to quickly create an expanded name.
Takes a local name as a string and returns its key in the string cache.
Takes a namespace prefix string and returns its key in a string cache.
Takes a namespace url string and returns its key in a string cache.
Maps the input of
Represents a set of "small characters", those with Unicode scalar values less than 64.