XmlParse()

Converts an XML document that is represented as a string variable into an XML document object.

XmlParse( xmlString=string, caseSensitive=boolean, validator=string, lenient=boolean );

Returns: Xml

Argument Description Default
xmlString
string, required

Any of the following:

Alias: xmlStr, xmlText, xml

caseSensitive
boolean, optional

Maintains the case of document elements and attributes. Default: false

validator
string, optional

Any of the following:

  • A string containing a DTD or Schema
  • The name of a DTD or Schema file
  • The URL of a DTD or Schema file; valid protocol identifiers include http, https, ftp, and file
lenient
boolean, optional

if set to true, the parser is more lenient and forgives invalid XML and does the best to interpret it.

false

Examples

xml_stream = "
    <note>
      <to>Alice</to>
      <from>Bob</from>
      <heading>Reminder</heading>
      <body>Here is the message you requested.</body>
    </note>
  ";
  dump(XmlParse(xml_stream));

See also