Skip to main content

Module xml

Module xml 

Source
Expand description

The document tree: namespace-qualified names, elements, and the parser and writer that turn a part of a package into one and back.

This is the substrate the rest of the crate reads through. It is a faithful tree rather than a model: attribute order, the choice between <a/> and <a></a>, comments, processing instructions and the whitespace between elements all survive a read and a write, so that a part this crate has no opinion about is returned unchanged.

Text is held unescaped, and escaped again on the way out in the canonical form. Byte identity across a round trip is therefore not claimed; what is claimed, and what tests/roundtrip.rs measures, is that parsing the output gives back an equal tree.

Structs§

Attribute
An attribute and its value, with the value unescaped.
Element
An element: its name, its attributes in the order they were written, and its children.
Name
A name as it appeared, and the namespace it resolved to.

Enums§

Node
One node of a parsed part.
Ns
An XML namespace, resolved from the URI it was declared with.

Functions§

parse
Parse one part of a package.
serialize
Serialize a part, declaration included.