Vipers

Release 1.0 - ...

Encoding vipers

The following table displays the characters being replaced for the various HTML, XML and SXML encoding vipers. Please note that numeric and character entity references are not taken into account when performing an encode operation.

Viper < > & " ' {
string.htmlencode(data) &lt; &gt; &amp; " ' {
string.htmlencode(data, includeQuotes) &lt; &gt; &amp; &quot; 1) &apos; 1) {
string.sxmlencode(data) &lt; &gt; &amp; " ' &#123;
string.sxmlencode(data, includeQuotes) &lt; &gt; &amp; &quot; 1) &apos; 1) &#123;
string.xmlencode(data) &lt; &gt; &amp; &quot; &apos; {
string.xmlencode(data, includeQuotes) &lt; &gt; &amp; &quot; 1) &apos; 1) {
string.xmlencode(data, codingOptions) &lt; 1) &gt; 1) &amp; 1) &quot; 1) &apos; 1) &#123; 1)
string.encodeampersand(data) < > &amp; " ' {
string.encodeattribute(data) < > &; &quot; &#39; {
string.encodeattribute(data, removeTags) &lt; 1) &lt; 1) & &quot; &#39; {
string.encodequotes(data) < > & &quot; &#39; {
sxml.disable(data) &lt; 2) &gt; 2) & " ' &#123; 3)

1) Depends on input parameters

2) Only for xml start and end tags in the Smartsite XML namespace (default prefix se:). Tags in other XML namespaces are left intact.

3) Only for curly brackets that precede a valid viper.

 The vipers EncodeAttribute and EncodeQuotes encode an apostrophe character (') into it's numeric entity reference counterpart and not into the named entity reference &apos;. The reason for this is that Internet Explorer doesn't handle the &apos; named entity in XHTML very well and will display the named character string as-is.

Decoding vipers

The following table lists the characters replacing entity references when decoding.

Viper &lt; &gt; &amp; &quot; &apos; numeric char
string.htmldecode(data) < > & &quot; &apos; yes yes
string.htmldecode(data, includeQuotes) < > & 1) 1) yes yes
string.sxmldecode(data) < > & &quot; &apos; yes no
string.sxmldecode(data, includeQuotes) < > & " 1) 1) yes no
string.xmldecode(data) < > & " ' yes no
string.xmldecode(data, includeQuotes) < > & &quot; 1) &apos; 1) yes no
string.xmldecode(data, codingOptions) &lt; 1) &gt; 1) &amp; 1) &quot; 1) &apos; 1) yes 1) yes 1)
string.decodeampersand(data) < > &amp; " ' no no

 

1) Depends on input parameters