Skip to main content

Module lexical

Module lexical 

Source
Expand description

Zero-copy lexical XML events and deterministic XML serialization.

This module is the parser-neutral boundary used before semantic DOM construction. The public event model intentionally does not expose the implementation tokenizer, so consumers can share source ranges, escaping, and serialization without inheriting a parser’s tree semantics.

Structs§

Attribute
A borrowed attribute from one start tag.
DeclaredNamespacePrefixes
Namespace prefixes declared directly by one lexical opening tag.
Name
A borrowed qualified XML name.
Scanner
Pull-based, zero-copy lexical scanner.
StartTag
A complete start or empty-element tag.
Writer
Deterministic UTF-8 XML writer for generated markup.

Enums§

Error
A lexical XML failure with a source position.
Event
One lexical XML event.

Functions§

declared_namespace_prefixes
Parse the namespace prefixes declared directly by one lexical opening tag.
decode_numeric_character_reference
Decode the portion of an XML numeric character reference after &#.
decode_references
Expand the five predefined entities and XML character references.
escape_attribute
Escape a double-quoted XML attribute value.
escape_text
Escape XML character data.
is_qname
Return whether value is an XML Namespaces 1.0 QName.