Contents > CFML Reference > ColdFusion Functions > XmlFormat PreviousNext

XmlFormat

Escapes special XML characters in a string, so that the string is safe to use with XML.

A copy of string that is safe to use with XML.

Extensibility functions, String functions, XML functions

XmlFormat(string)

cfxml, IsXmlDoc, XmlChildPos, XmlChildPos, XmlNew, XmlParse, XmlSearch, XmlTransform

ColdFusion MX: Added this function.

Parameter

Description

string

A string or a variable that contains one

The characters that this function escapes include the following:

<h3>XMLFormat</h3>
<p>This example shows how XMLFormat is used to escape special 
XML characters and make the use of XML with ColdFusion easy.</p> <XMP> <?xml version = "1.0"?> <cfoutput> <someXML> <someElement someAttribute = "#XMLFormat("'a quoted value'")#> #XMLFormat( "Body of element to be passed here.")# </someElement> </someXML> </cfoutput> </XMP>

Contents > CFML Reference > ColdFusion Functions > XmlFormat PreviousNext

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.