Expand description
Native xml module for XML parsing and serialization.
Exports: xml.parse(text), xml.stringify(value)
XML nodes are represented as Shape TypedObjects with the XmlNode
schema: { name: string, attributes: HashMap<string, string>, children: Array<XmlNode>, text: string }
W17-out-of-bundle-A-followups (2026-05-12): children rewire per the
C+ precedent recorded in phase-2d-playbook.md §3
(“Bundle-A checkpoint-2 amendment”). Pre-rewire, each child was an
Arc<HeapValue::HashMap> carried inside the deleted
TypedArrayData::HeapValue arm. Post-rewire, each child is an
Arc<HeapValue::TypedObject> with the registered XmlNode schema,
and the outer children array lowers to TypedArrayData::TypedObject
per ADR-006 §2.7.24 Q25.A’s specialized list.
User-visible API: node.children[i].name / .attributes / .text
continue to work via TypedObject field access (same shape as the
prior HashMap dispatch). The text field is now always present
(empty string when absent); the prior optional-field shape was
already flattened.
Stage C HashMap-marshal P1(b) historical context (2026-05-07):
xml.parsereturns the root element asTypedReturn::OkObjectPairsper Cluster #4 β shape (mirrorsarrow.metadata/ http.rs precedents).xml.stringifytakesvalue: HashMap<string, *>typed input viaVec<(Arc<String>, Arc<HeapValue>)>FromSlot from Step 1 P1(b) infrastructure (commit36519f6). Walks the recursive HeapValue tree using direct pattern matching — no marshal-boundary re-entry per element. The reader now dispatches thechildrenfield throughTypedArrayData::TypedObjectper the post-rewire construction shape.- Attributes (
HashMap<string, string>) carried viaConcreteReturn::HashMapStringStringon output and read directly fromHeapValue::HashMap(d)on input.
Tests deleted along with the legacy ValueWord-based fixtures, mirroring
the csv_module migration (commit 9f6b1d3). New typed-marshal test
harness arrives with the shape-vm cleanup workstream.
Functions§
- create_
xml_ module - Create the
xmlmodule with XML parsing and serialization functions.