CFXML: Probing XMLDOM in ColdFusion - On accessing a structure
(Page 3 of 5 )
What if you want to access the structure as a whole? No problem; by using the <cfdump> tag,we can get the structure of the required elements. Review the following code and its display for the "children" of the root element.
<cffile action="read" file="C:\Inetpub\wwwroot\webstudents.xml"
variable="xmldoc">
<cfset mydoc = XmlParse(xmldoc)>
<cfset rootchild=#mydoc.XMLRoot.XMLChildren#>
<cfdump var="#rootchild#">
The next picture shows the structure with the "element" details collapsed and the picture that follows shows it with one (the fourth) of the "xml elements" expanded. By clicking on the xml element row in the browser display you can expand or collapse the nodes.

The 4th xml element node expanded view.

Next: How do we get to the attributes? >>
More ColdFusion Articles
More By Jayaram Krishnaswamy