Skip to main content

Module xml_text

Module xml_text 

Source
Expand description

Helpers for turning quick-xml text events into plain Rust strings.

Since quick-xml 0.41 a character or general entity reference (&, A) is reported as its own Event::GeneralRef rather than being folded into the surrounding Event::Text. Any loop that accumulates the text of an element therefore has to handle both events, or entities are silently dropped from the result.

Functionsยง

decode_escaped
Decode a BytesText and resolve any XML entities it still contains.
decode_plain
Decode an Event::Text payload, which quick-xml has already stripped of entity references (those arrive separately as Event::GeneralRef).
read_element_text
Read the full text content of the element that start_name opened, resolving entity references.
resolve_entity
Resolve a single entity reference event to the text it stands for.