User Guide

Table Of Contents
The XML document object 845
A simple XML document
The next sections describe the basic and node views of the following simple XML document. This
document is used in many of the examples in this chapter.
<?xml version="1.0" encoding="UTF-8"?>
<employee>
<!-- A list of employees -->
<name EmpType="Regular">
<first>Almanzo</first>
<last>Wilder</last>
</name>
<name EmpType="Contract">
<first>Laura</first>
<last>Ingalls</last>
</name>
</employee>
Basic view
The basic view of an XML document object presents the object as a container that holds one root
element structure. The root element can have any number of nested element structures. Each
element structure represents an XML tag (start tag/end tag set) and all its contents; it can contain
additional element structures. A basic view of the simple XML document looks like the following:
DOM node view
The DOM node view presents the XML document object using the same format as the
documents 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.
Document Object
Root Element: employee
Comment: A list of employees
Element: first
Text:
Almanzo
Element: name
Attributes: EmpType = Regular
Element: name
Attributes: EmpType = Contract
Element: first
Text:
Wilder
Element: first
Text:
Laura
Element: first
Text:
Ingallis