Skip to main content

Module xml_utils

Module xml_utils 

Source
Expand description

XML building primitives: tag, escape_xml, and extract_xml_tag_value. Low-level XML building primitives used throughout the crate.

These utilities are deliberately simple and allocation-efficient: they work on &str slices and return owned Strings, with no external XML library dependency.

Enums§

TagContent
Content variants for the tag builder function.

Functions§

escape_xml
Escape special XML characters in text content and attribute values, replacing &, <, >, ", and ' with their XML entity equivalents.
extract_xml_tag_value
Extract the text content of the first occurrence of a simple XML tag in a raw XML string.
tag
Build an XML tag with optional attributes and children.