Home arrow ColdFusion arrow CFXML: Probing XMLDOM in ColdFusion

CFXML: Probing XMLDOM in ColdFusion

This tutorial examines how to access the individual elements of an XML document in ColdFusion, if you have a reference to that document. Two ways to access the individual elements are demonstrated.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 16
April 03, 2006
  1. · CFXML: Probing XMLDOM in ColdFusion
  2. · Create a ColdFusion Object Using the Microsoft.XMLDOM Class
  3. · On accessing a structure
  4. · How do we get to the attributes?
  5. · How do we get at the Comment node?

print this article

CFXML: Probing XMLDOM in ColdFusion
(Page 1 of 5 )


Following the enormous success of AJAX, there has been a great deal of activity in probing the XMLDOM. In an earlier tutorial, accessing the XMLDOM using Javascript/ECMAScript was described. For an example XML file, a complete analysis of accessing the individual parts was presented using the DOM's structure.

If you have a reference to an XML document, how do you access individual elements in ColdFusion? Well, this tutorial looks at this question using the same example file used in the previous tutorials. This tutorial shows two ways to access the individual elements of the XMLDOM object, referenced as an object and as a structured file. Also available are third party tools that do the XML parsing.

The example XML File

The xml file used in this tutorial, webstudents.xml, has a simple structure. It represents students taking a web programming class, with some information about their skills as shown below. It is a well formed XML file and does not have a schema, or a DTD. It is assumed that the example file is in a virtual directory and that the IIS server has been configured for the CF MX Server.

<?xml version="1.0" encoding="ISO-8859-1" ?> 
<!-- My students who attended my web programming class --> 
<student id="1"> 
<name>Linda Jones </name>  
<legacySkill>Access, VB5.0 </legacySkill> 
<student id="2"> 
<name>Adam Davidson </name>  
<legacySkill>Cobol, MainFrame </legacySkill> 
<student id="3"> 
<name>Charles Boyer </name>  
<legacySkill>HTML, Photoshop </legacySkill> 
<student id="4"> 
<name>Charles Mann </name>  
<legacySkill>Cobol, MainFrame </legacySkill> 

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials