CX · Reference guidexml
PlaygroundDownloadsAboutv0.18.0-pre.1

xml

The xml codec surface (core; spec/03-approved/core/codec.md §3), reached with [?lib 'cx-stdlib/xml']. Four uniform verbs convert between xml and the CX tree, which is the universal pivot: every conversion is format → tree → format, never format → format. Synthesized from the codec registry, so this surface cannot drift from what the build can actually convert.

xml:parse

[$xml:parse] -> any — Parse xml source TEXT into a CXDM value.

xml:parse-bytes

[$xml:parse-bytes] -> any — Parse xml source BYTES into a CXDM value — the binary half of the codec contract.

xml:emit

[$xml:emit] -> string — Emit a CXDM value as xml TEXT.

xml:emit-bytes

[$xml:emit-bytes] -> bytes — Emit a CXDM value as xml BYTES — the binary half of the codec contract.

xml:parse-with-opts

[$xml:parse-with-opts] -> any — Parse xml source text under an option map (codec.md §3.2). The key set is CLOSED — an unknown key or an out-of-range value REFUSES, naming what the codec accepts, rather than being silently ignored.

xml:emit-with-opts

[$xml:emit-with-opts] -> string — Emit a CXDM value as xml text under an option map (codec.md §3.2). The key set is CLOSED — an unknown key or an out-of-range value REFUSES rather than being silently ignored.