XML functions
- Applies to:
- All MindTouch Versions
- Role required:
- Draft Contributor
These XML functions are part of the DekiScript and Expert runtime environment.
xml.date(doc, xpath, namespaces) : str
Get a date-time value from an XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | (optional) xpath to value (default: ".") |
namespaces | map | (optional) namespaces (default: none) |
xml.format(doc, style) : str
Render the XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
style | str | (optional) formatting style (one of "plain", "xhtml", "indented"; default: "indented") |
xml.html(doc, xpath) : xml
Render a selection of nodes into an xml document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | (optional) xpath for selector |
xml.list(doc, xpath, namespaces, xml) : list
Get list of values from an XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | xpath to list of values |
namespaces | map | (optional) namespaces (default: none) |
xml | bool | (optional) capture enclosing XML element (default: false) |
xml.name(doc) : str
Get the name of the root node in the XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xml.num(doc, xpath, namespaces) : num
Get a number from an XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | (optional) xpath to value (default: ".") |
namespaces | map | (optional) namespaces (default: none) |
xml.replace(doc, substitutions) : xml
Replace nodes in XML document selected by xpath-to-value map.
Name | Type | Description |
---|---|---|
doc | xml | |
substitutions | map |
xml.select(doc, xpath, namespaces) : xml
Create an XML selection using an xpath.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | (optional) xpath for selector |
namespaces | map | (optional) namespaces (default: none) |
xml.text(doc, xpath, namespaces, xml, inner) : str
Get a text value from an XML document.
Name | Type | Description |
---|---|---|
doc | xml | XML document |
xpath | str | (optional) xpath to value (default: ".") |
namespaces | map | (optional) namespaces (default: none) |
xml | bool | (optional) include XML elements (default: false) |
inner | bool | (optional) include only inner XML (default: false ) |