Xml Serializer¶
| Spice | |
|---|---|
XmlSerializer struct¶
Serializer for XML output.
Elements without children are written as self-closing tags. Text content and attribute values are escaped with the predefined entities, so the result round-trips through parseXml from "std/text/xml-parser".
In pretty mode, elements that contain child elements are laid out with two-space indentation, one node per line; elements containing only text are kept on a single line.
Constructors¶
ctor¶
| Spice | |
|---|---|
Construct an XML serializer
Parameters
| Name | Type | Description |
|---|---|---|
pretty |
bool |
Emit human-readable output with two-space indentation (default: false) |
Methods¶
serialize¶
| Spice | |
|---|---|
Serializes an XML node into an XML string
Parameters
| Name | Type | Description |
|---|---|---|
node |
XmlNode& |
XML node to serialize |
Returns: String — XML representation
serialize¶
| Spice | |
|---|---|
Serializes an XML node into an XML string
Parameters
| Name | Type | Description |
|---|---|---|
node |
XmlNode* |
XML node to serialize |
Returns: String — XML representation