| Contents > CFML Reference > ColdFusion Tags > cfxml |
|
|
|
|
||
Creates a ColdFusion XML document object that contains the markup in the tag body. This tag can include XML and CFML tags. ColdFusion processes the CFML code in the tag body, then assigns the resulting text to an XML document object variable.
<CFXML
variable="xmlVarName"
caseSensitive="yes" or "no">
IsXmlDoc, IsXmlElem, IsXmlRoot, XmlChildPos, XmlNew, XmlParse, XmlSearch, XmlTransform
ColdFusion MX: Added this tag.
Attribute |
Req/Opt |
Default |
Description |
|---|---|---|---|
variable |
|
|
Name of an xml variable |
caseSensitive |
Optional |
no |
|
An XML document object is represented in ColdFusion as a structure.
The following example creates a document object whose root element is MyDoc. The object includes text that displays the value of the ColdFusion variable testVar. The code creates four nested child elements, which are generated by an indexed cfloop tag. The cfdump tag displays the XML document object.
Note: Do not include an <?xml ?> processing directive in the cfxml tag body. This directive is not required for processing, and causes an error. To process XML text that includes this directive, use the XmlParse function.
<cfset testVar = True>
<cfxml variable="MyDoc">
<MyDoc>
<cfif testVar IS True>
<cfoutput>The value of testVar is True.</cfoutput>
<cfelse>
<cfoutput>The value of testVar is False.</cfoutput>
</cfif>
<cfloop index = "LoopCount" from = "1" to = "4">
<childNode>
This is Child node <cfoutput>#LoopCount#.</cfoutput>
</childNode>
</cfloop>
</MyDoc>
</cfxml>
<cfdump var=#MyDoc#>
|
|
||
| Contents > CFML Reference > ColdFusion Tags > cfxml |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-b21.htm
Comments
alancole said on Aug 13, 2003 at 8:36 AM : alancole said on Aug 13, 2003 at 8:58 AM : cliffyman said on Sep 27, 2003 at 5:40 PM : 0034 said on Jan 29, 2004 at 1:02 AM :