XmlParse()

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

XmlParse( xmlString=string, caseSensitive=boolean, validator=any, 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
any, 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
  • A struct of xmlFeatures directives - since 5.4.2.20
lenient
boolean, optional

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

Introduced: 5.3.8.135

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