xml

Formats a string for use in XML.

This function replaces non-alphanumeric characters with the correct XML sequence that represents the character. For example, the ampersand "&" character is replaced with the "&" sequence.

When using a double-quote character within a string, a backslash "\" must precede the double-quote to display it as a character. If the backslash is not used as an escape flag, the double-quote is interpreted as ending the string.

Type and Usage

Parameters

The only parameter is the string.

Output

Returns a string formatted for use in a URL.

Example

Escapes the ampersand and returns the XML formatted string, "Me & you."

<$xml("Me & you.")$>

Escapes the non-alphanumeric characters and returns the XML-formatted string, "Test the &quot;, &gt;, and &lt; characters."

<$xml("Test the \", >, and < characters.")$>