ColdFusion 9.0 Resources |
XmlFormatDescriptionEscapes special XML characters in a string so that the string can be used as text in XML. See alsocfxml, XmlNew, XmlParse, XmlValidate; Using XML and WDDX in the Developing ColdFusion Applications Parameters
UsageThis function escapes characters as follows:
ExampleThe following example shows how XmlFormat escapes special XML characters. Use the View Source command in the browser to see the results. ColdFusion interprets the "" in the second text string as representing a single-quotation mark in text before it applies the XmlFormat function. <?xml version = "1.0"?> <cfoutput> <someXML> <someElement someAttribute="#XmlFormat("'a quoted value'", "true")#"> #XmlFormat("Body of element with <, >, "" and & goes here.", "true")# </someElement> </someXML> </cfoutput> |