The XML document object
ColdFusion represents an XML document as an object, called an XML document object, that is
much like a standard ColdFusion structure. In fact, most ColdFusion structure functions, such as
, work with XML document objects. For a full list of ColdFusion functions that
StructInsert
work on XML document objects, see
You can look at the overall structure of an XML document in two ways: a basic view and a DOM
(Document Object Model)-based node view. The basic view presents all the information in the
document, but does not separate the data into as fine-grained units as the node view. ColdFusion
can access XML document contents using either view.
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:
"Functions for XML object management" on page
The XML document object
682.
671
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers