String XmlEncode Example

Demonstrates the xml encoding of string input

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

Default xml encode: {string.xmlencode($data)}

Xml encode without quotes: {string.xmlencode($data, false)}

Custom xml encode: {string.xmlencode($data, 'ampersand,quotationmark')}
Example Result CopyCode image Copy Code
Default xml encode: 
    &lt;b&gt;this text contains &apos; and &quot; quotes&lt;/b&gt;


Xml encode without quotes: 
    &lt;b&gt;this text contains ' and " quotes&lt;/b&gt;


Custom xml encode: 
    <b>this text contains ' and " quotes</b>
SXML