Parsing XML Documents
An XML document by itself is just a string of text. To harness the power of XML, you must parse it to create an object that ColdFusion can access much like a collection of structures and arrays.
Using XmlParse()
To parse an XML document stored somewhere on disk, use <cffile> and XmlParse(), as demonstrated in Listing 14.2.
Listing 14.2. ParseXML.cfmParsing an XML Document on Disk
Figure 14.1 shows the output of xmlObject in the browser.
<cffile action="READ"
file="#ExpandPath('CompaniesAndEmployees.xml')#"
variable="xmlDocument">
<cfset xmlObject = XmlParse(xmlDocument, "Yes")>
<cfdump var="#xmlObject#">
Figure 14.1. A ColdFusion XML object as displayed by <cfdump>.
