Xmlnew - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

XmlNew

Description
Creates an XML document object.
Returns
An empty XML document object.
Category
Extensibility
functions,
Function syntax
XmlNew([caseSensitive])
See also
cfxml, IsXmlDoc, XmlChildPos, XmlChildPos, XmlFormat, XmlParse, XmlSearch,
XmlTransform
History
ColdFusion MX: Added this function.
Parameters
Parameter
caseSensitive
Usage
An XML document object is represented in ColdFusion as a structure.
The
caseSensitive
varying case, but are otherwise the same, refer to different components. For example:
If
caseSensitive = "no"
mydoc.employee.NAME[1] refer to the same element
If
caseSensitive = "yes"
The following example creates and displays a ColdFusion document object. For more
information on this example, see
ColdFusion MX Applications.
Example
<cfset testVar = True>
<cfscript>
MyDoc = XmlNew();
MyDoc.xmlRoot = XmlElemNew(MyDoc,"MyRoot");
if (testVar IS TRUE)
MyDoc.MyRoot.XmlText = "The value of testVar is True.";
else
MyDoc.MyRoot.XmlText = "The value of testVar is False.";
for (i = 1; i LTE 4; i = i + 1)
{
MyDoc.MyRoot.XmlChildren[i] = XmlElemNew(MyDoc,"childNode");
MyDoc.MyRoot.XmlChildren[i].XmlText = "This is Child node " & i &".";
742
Chapter 3: ColdFusion Functions
XML functions
Description
Determines how ColdFusion processes the case of XML document object
component identifiers
• yes: maintains case
• no. ColdFusion ignores case. Default.
attribute value determines whether identifiers whose characters are of
, the names mydoc.employee.name[1] and
, these names refer to two distinct elements
Chapter 31, "Using XML and WDDX,"
in Developing

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents