Escapes XML special characters in a string, so that the string is safe to use with XML.
xmlFormat(String [, escapeChars])
returns string
Name | Type | Required | Default | Description |
---|---|---|---|---|
String | string | Yes | The string to escape | |
escapeChars | boolean | No | When true escapes restricted characters according to the W3C XML standard. |
In this example we demonstrate passing the invalid characters < and & into the xmlFormat() function to make them XML safe.
writeOutput( xmlFormat( '<node>Good & Juicy</node>') );