xml_parse_string converts a valid XML string into a UniScript object.
Return Value
o is an XML tree or an Error object (see error_create). o contains the elements name and the optional elements attr. The child elements are saved in enumerated keys starting with 1.
xml_parse_string("<a/>")
[.
name = "a"
]
xml_parse_string("<a att='1'/>")
[.
attr = [.
att = "1"
]
name = "a"
]
xml_parse_string("<a att='1'>mixed<b>contents</b></a>")
[.
[1] = "mixed"
[2] = [.
[1] = "contents"
name = "b"
]
attr = [.
att = "1"
]
name = "a"
]
Parameters
ssXML is a valid XML string.
nOptions is a combination of the following values:
| NO_SKIP_WHITESPACE (1) |
|
| NO_SHORT_ATTR (2) | Informations about the order of attributes are saved in the object. |
Comment
The XML declaration at the beginning of the string will be ignored.
<?xml version="1.0" encoding="UTF-8" ?>
The input string ssXML must contain valid UNICODE characters. text_file_read returns for ANSI- and utf-8 coded text files UNICODE strings.
History
| Version | Description |
|---|---|
| 5.20 | New. |
See also
id-111701