Adobe COLDFUSION 9 Manual page 1065

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
DOM node view
The DOM node view presents the XML document object using the same format as the document's XML Document
Object Model (DOM). In fact, an XML document object is a representation of a DOM object.
The DOM is a World Wide Web Consortium (W3C) recommendation (specification) for a platform- and language-
neutral interface to dynamically access and update the content, structure, and style of documents. ColdFusion
conforms to the DOM Level 2 Core specification, available at www.w3.org/TR/DOM-Level-2-Core.
In the DOM node view, the document consists of a hierarchical tree of nodes. Each node has a DOM node type, a node
name, and a node value. Node types include Element, Comment, Text, and so on. The DOM structures the document
object and each of the elements it contains into multiple nodes of different types, providing a finer-grained view of the
document structure than the basic view. For example, if an XML comment is in the middle of a block of text, the DOM
node view represents its position in the text while the basic view does not.
ColdFusion also lets you use the DOM objects, methods, and properties defined in the W3C DOM Level 2 Core
specification to manipulate the XML document object.
For more information on referencing DOM nodes, see
does not cover the node view and using DOM methods and properties in detail.
XML document structures
An XML document object is a structure that contains a set of nested XML element structures. The following image
shows a section of the
cfdump
page 1059. This image shows the long version of the dump, which provides complete details about the document
object. Initially, ColdFusion displays a short version, with basic information. Click the dump header to change between
short, long, and collapsed versions of the dump.
The following code displays this output. It assumes that you save the code in a file under your web root, such as
C:\Inetpub\wwwroot\testdocs\employeesimple.xml
<cffile action="read" file="C:\Inetpub\wwwroot\testdocs\employeesimple.xml"
variable="xmldoc">
<cfset mydoc = XmlParse(xmldoc)>
<cfdump var="#mydoc#">
The document object structure
At the top level, the XML document object has the following three entries:
"XML DOM node
tag output for the document object for the XML in
Last updated 8/5/2010
structure" on page 1061. This document
"A simple XML
document" on
1060

Advertisement

Table of Contents
loading

Table of Contents