Skip to main content

Module xml

Module xml 

Source
Expand description

the XML subset: formats::xml (here until 0.3.0)

Modules§

lenient
reader

Structs§

Attr
one attribute of a start tag
Lenient
the forgiving reader (see the top of this file)
Limits
What one parse may take: the text’s bytes, its elements, their nesting. The default (4 MiB, 30000 elements, 48 levels) is parse’s; a reader whose own model bounds its documents otherwise names what that model can expand to (parse_with).
Name
Expanded XML name (prefixes are not identities).
Node
Element-only or text-only node; mixed content is rejected by this subset reader.
ReadError
an error and the byte offset it was found at
Reader
the strict pull reader (see the top of this file)
Start
a start tag

Enums§

Error
Syntax error, resource limit, or an intentionally unsupported XML construct.
Event
what the reader found next
Token
what the lenient reader found next

Constants§

NS_XML
the namespace of the xml prefix (xml:lang, xml:space)
NS_XMLNS
the namespace of namespace declarations (xmlns, xmlns:p)

Functions§

escape
Escape text/attribute content, including CR so it survives XML newline normalization.
parse
Parse a bounded XML subset into a tree. DTDs, processing instructions, comments, CDATA and mixed content are explicitly rejected (Unsupported). No resources are ever resolved or fetched.
parse_with
parse within other limits than the default ones. The tree is built from the strict Reader without recursion; a limit of the reader (nesting, attributes, bindings) is Limit here.
valid_char
XML 1.0 character validity (also used before emitting document text).