Skip to main content

Module convert

Module convert 

Source
Available on crate features source-rest and source-xml only.
Expand description

XML to JSON conversion.

Converts XML documents to serde_json::Value preserving the element hierarchy. Attributes are prefixed with @, text content uses #text.

Functions§

extract_at_path
Navigate into a JSON value using a dot-separated path and extract matching records. If the final element is an array, its items are returned individually.
stream_extract
Walk an XML document with quick_xml::Reader::read_event and invoke on_record once per element whose path matches the dot-separated records_element_path selector. Records are materialised as JSON values in the same shape xml_to_json would produce — attributes become @key entries, repeated children become arrays, and a single #text child is flattened to a bare string.
xml_to_json
Convert an XML string to a JSON value.