Expand description
Serialize a sup_xml_tree::dom::Document back to XML text.
Mirrors the existing crate::serializer module — same option type
(crate::SerializeOptions), same escaping rules, same compact and
pretty-print layouts — but walks the arena tree (Node::children() /
Node::attributes() iterators) rather than the legacy Vec<Node> /
Vec<Attribute> fields.
§Example
use sup_xml_core::{parse_str, serialize_to_string, ParseOptions};
let doc = parse_str("<r><a id='1'/></r>", &ParseOptions::default()).unwrap();
let xml = serialize_to_string(&doc);
assert!(xml.contains(r#"<a id="1"/>"#));Structs§
- Serialize
Options - Options that control how a
Documentis serialized back to XML text.
Functions§
- serialize_
formatted - Serialize an arena
Documentwith pretty-printing (newlines + indentation). - serialize_
html_ to_ string - Serialize an arena
Documentas HTML5. Emits the DOCTYPE if the document carries one, never emits an XML declaration, uses HTML5 void- element / raw-text / boolean-attribute conventions. Same shape ascrate::serialize_html_to_stringbut accepts the arena tree. - serialize_
node_ to_ string - Serialize a single
Node(and its descendants) without the surrounding document machinery (no XML declaration, no DOCTYPE). Used by the libxml2 ABI shim’sxmlNodeDumpand by callers that want a subtree string. - serialize_
to_ bytes - Serialize an arena
Documentto a compact UTF-8 byte vector. - serialize_
to_ string - Serialize an arena
Documentto a compact XML string with default options. - serialize_
with - Serialize an arena
Documentwith full control viaSerializeOptions.