<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>XMLFORMAT</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">XMLFORMAT</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Escapes special XML characters in a string so that the string can be used as text in XML. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
A copy of the string parameter that is safe to use as text in XML.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
String functions, XML functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>XmlFormat(string)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfxml, XmlNew, XmlParse, XmlValidate; Chapter&#160;35, "Using XML and WDDX" in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX: Added this function.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
This function escapes characters as follows: 
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span>
<p>
The following example shows how XmlFormat escapes special XML characters. Use the View Source command in the browser to see the results. ColdFusion interprets the &quot;&quot; in the second text string as representing a single-quotation mark in text before it applies the XmlFormat function.
</p>
<pre>&lt;?xml version = &quot;1.0&quot;?&gt; 
&lt;cfoutput&gt;
&lt;someXML&gt;
   &lt;someElement someAttribute=&quot;#XmlFormat(&quot;&#39;a quoted value&#39;&quot;)#&quot;&gt; 
      #XmlFormat(&quot;Body of element with &lt;, &gt;, &quot;&quot; and &amp; goes here.&quot;)#
   &lt;/someElement&gt;
&lt;/someXML&gt;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="STRING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">STRING</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A string or a variable that contains one</p>

  </td>
  </tr>
  </table>
</div>

<p>Greater than symbol (&gt;)</p>

<p>&amp;gt;</p>

  </td>
  </tr>
  </table>
</div>

<p>Less than symbol (&lt;)</p>

<p> &amp;lt;</p>

  </td>
  </tr>
  </table>
</div>

<p>Single-quotation mark (&#39;)</p>

<p>&amp;apos;</p>

  </td>
  </tr>
  </table>
</div>

<p>Double-quotation mark (&quot;)</p>

<p>&amp;quot;</p>

  </td>
  </tr>
  </table>
</div>

<p>Ampersand symbol (&amp;)</p>

<p>&amp;amp;</p>

  </td>
  </tr>
  </table>
</div>

<p>Carriage return (but not line feed)</p>

<p>Removed from the text.</p>

  </td>
  </tr>
  </table>
</div>

<p>High ASCII characters in the range 128-255.</p>

<p>Replaced by unicode escape sequence; for example,  (capital E with an Acute symbol) is replaced by &amp;#xc9;.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
