View comments | RSS feed

XmlNew

Description

Creates an XML document object.

Return value

An empty XML document object.

Category

Extensibility functions, XML functions

Syntax

XmlNew([caseSensitive])

See also

cfxml, IsXmlDoc, XmlChildPos, XmlChildPos, XmlFormat, XmlParse, XmlSearch, XmlTransform

History

New in ColdFusion MX: this function is new.

Parameters

Parameter Description
caseSensitive
Determines how ColdFusion processes the case of XML document object component identifiers
  • yes: maintains case
  • no. ColdFusion ignores case. Default.

Usage

An XML document object is represented in ColdFusion as a structure.

The caseSensitive attribute value determines whether identifiers whose characters are of varying case, but are otherwise the same, refer to different components. For example:

The following example creates and displays a ColdFusion document object. For more information on this example, see Developing ColdFusion MX Applications with CFML.

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 &".";
    }
</cfscript>
<cfdump var=#MyDoc#>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


erikphilips said on Oct 2, 2002 at 4:19 AM :
And type "monitor"
erikphilips said on Jul 25, 2002 at 9:21 PM :
XmlChildPos is listed Twice.
ctina said on Jul 26, 2002 at 1:51 PM :
Update from Macromedia: thanks for noting the double link. We'll correct it in the next set of documentation.
Christina Lamkin, ColdFusion documentation team

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt2121.htm