xmlParse

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

xmlParse(xmlString [, caseSensitive] [, validator]) → returns xml

Argument Reference

xmlString string
Required

Any of the following:
- A string containing XML text.
- The name of an XML file.
- The URL of an XML file; valid protocol identifiers
include http, https, ftp, and file.

caseSensitive boolean
Default: false

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

validator string

Any of the following:
- The name of a Document Type Definition (DTD) or
XML Schema file.
- The URL of a DTD or Schema file; valid protocol
identifiers include http, https, ftp, and file.
- A string representation of a DTD or Schema.
- An empty string; in this case, the XML file must
contain an embedded DTD or Schema identifier, which
is used to validate the document.

Examples
Sample code invoking the xmlParse function

Read XML from a file and use the xmlParse method to parse it into an XML data structure.

<cffile action="read" file="#tempxml#" variable="xmlString">
<cfset myXML = xmlParse(xmlString)>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub