String XmlEncode and XmlDecode Advanced Example

Xml encoding vipers always perform a double ampersand encode. This implies that decoding an encoded viper is symmetric for the client. The following example demonstrates this behavior.

Smartsite SXML CopyCode image Copy Code
<se:buffer name="data">
    <b>this text contains ' and " quotes</b>
</se:buffer>

{string.xmldecode(string.xmlencode($data))}
Example Result CopyCode image Copy Code
<b>this text contains ' and " quotes</b>
SXML