XMLTools
ParseString
parse a Maple string containing XML data
Calling Sequence
Parameters
Description
Examples
Compatibility
ParseString(xmlString, opts)
xmlString
-
string; XML element
opts
equation(s) of the form option=value; specify parsing options
The ParseString(xmlString) command parses the input string xmlString, which is assumed to be a valid XML document.
Errors detected by the parser in this routine are reported, but the parser does not validate the XML structure. Only errors that prevent this routine from converting the input string into an internal XML format are detected.
The opts argument can contain one or more equations that set parsing options. For a complete description, see XMLTools[ParseFile].
Important: The parser used for this routine is not a validating parser.
with⁡XMLTools:
ParseString⁡<a></a>
_XML_Document⁡_XML_Element⁡_XML_ElementType⁡a,,_XML_Text⁡
ParseString⁡<a/>
_XML_Document⁡_XML_Element⁡_XML_ElementType⁡a,,
ParseString⁡<a attrname='attrval'>text</a>
_XML_Document⁡_XML_Element⁡_XML_ElementType⁡a,_XML_Attribute⁡_XML_AttrName⁡attrname,_XML_AttrValue⁡attrval,_XML_Text⁡text
ParseString⁡<a>text1<b>text2</b></a>
_XML_Document⁡_XML_Element⁡_XML_ElementType⁡a,,_XML_Text⁡text1,_XML_Element⁡_XML_ElementType⁡b,,_XML_Text⁡text2
ParseString⁡<a attr1='val1'>text1<b attr2='val2' attr3='val3'>text2</b></a>
_XML_Document⁡_XML_Element⁡_XML_ElementType⁡a,_XML_Attribute⁡_XML_AttrName⁡attr1,_XML_AttrValue⁡val1,_XML_Text⁡text1,_XML_Element⁡_XML_ElementType⁡b,_XML_Attribute⁡_XML_AttrName⁡attr2,_XML_AttrValue⁡val2,_XML_Attribute⁡_XML_AttrName⁡attr3,_XML_AttrValue⁡val3,_XML_Text⁡text2
ParseString⁡<?xml version='1.0'>
Error, (in XMLTools:-ParseString) A pseudo attribute name is expected.
ParseString⁡<![CDATA[This is <b>not</b> parsed.]]>
Error, (in XMLTools:-ParseString) The markup in the document preceding the root element must be well-formed.
The externaldtd option was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
XMLTools[ParseFile]
XMLTools[Print]
XMLTools[ToString]
Download Help Document