ColdFusion
  Home arrow ColdFusion arrow Page 5 - CFXML: Probing XMLDOM in ColdFusion
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
COLDFUSION

CFXML: Probing XMLDOM in ColdFusion
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2006-04-03

    Table of Contents:
  • CFXML: Probing XMLDOM in ColdFusion
  • Create a ColdFusion Object Using the Microsoft.XMLDOM Class
  • On accessing a structure
  • How do we get to the attributes?
  • How do we get at the Comment node?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    CFXML: Probing XMLDOM in ColdFusion - How do we get at the Comment node?


    (Page 5 of 5 )

    Well most of the document has been sliced and diced, how are we to get to the comment, which also happens to be a node in the XMLDOC? Review the following snippet. The "comment" happens to be a comment to the root element rather than to the document itself. Also note that trying to cfdump a string gets you a string and it is only when you cfdump a structure that you would get the structure of the node, as we have seen in the previous examples.

    <cfset mydoc = XmlParse(xmldoc)>
    <cfset wchild=#mydoc.XMLComment#>
    mydoc.XMLComment=
    <cfdump var="#wchild#"><!---returns [empty string]--->
    <br/>
    <cfoutput>
    #wchild#
    </cfoutput>
    <br/>
    <cfset wnodes=#mydoc.XMLRoot.XMLName#>
    <cfoutput>
    mydoc.XMLRoot.XMLName=
    #wnodes#
    </cfoutput>
    <br/>
    <cfdump var="#wnodes#">
    <br/>
    <cfset wcomnt=#mydoc.wclass.XMLComment#>
    <cfoutput>
    mydoc.wclass.XMLComment=
    "
    #wcomnt#
    "
    </cfoutput>
    

    The display in the browser would appear as follows:

    Summary

    This tutorial clearly shows two ways to probe the XMLDOM in ColdFusion. In the first method, it accesses via the object created using Microsoft ActiveX, and in the second the XMLDOC object is probed using its XML File. The syntax of accessing is different and the reader is warned to check which of these are used. In case you are using the second method with XMLDOC via this file reference, please refer to Macromedia's documentation. The detailed example illustrated in this tutorial should help in understanding the documentation.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · The tutorial discusss two ways to access an XML document using ColdFusion. The...
     

    COLDFUSION ARTICLES

    - 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...
    - My First Application on ColdFusion MX Server







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway