xml
XML parsing and serialization.
Functions
from_str xml
Parses an XML string and returns the root element as an Node.
Parameters:
| Name | Type | Description |
|---|---|---|
xml |
str |
XML string to parse |
Returns: Node -- The root element
Errors: Raises an error if the XML is invalid or has no root element.
to_str node
Serializes a value to an XML string.
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Node or str |
The node or text to serialize |
Returns: str -- XML string
Errors: Raises an error if the value cannot be serialized.
Types
Node-- XML element node