Helma logo
helma.org » Home > Stories > res.encodeXml()

res.encodeXml()

Writes a string to the output buffer, replacing some characters with their equivalent XML entities.

This function substitutes the characters '<', '>', '&', as well as single and double quotes with their predefined XML 1.0 entities. Additionally, some characters that are illegal in XML documents are silently dropped.

encodeXml() is usually used to encode text for safe inclusion in parsed character data sections of XML documents.

Syntax
res.encodeXml(String)

Example
res.encodeXml("<title>Smørebr&oslash;d</title>");
&lt;title&gt;Smørebr&amp;oslash;d&lt;/title&gt;


... comment


Page last modified on 2003-08-19 17:46 by hns