XMLENCODE

XMLENCODE( xml [, ALL ] )

xmlThe XML to encode.
ALLOptional. Specifies including new line characters in the encoding so the text can be used in attribute definitions.
Return:XMLENCODE returns a single value.

The XMLENCODE function encodes special characters in an XML string (for example, < is converted to &lt) allowing you to use the CSV option on OUTPUT to produce more complex XML files than are possible by using the XML option.

Example:

encoded := XMLENCODE('<xml version 1><tag>data</tag>');
decoded := XMLDECODE(encoded);

OUTPUT(encoded); //results in '&lt;xml version 1&gt;&lt;tag&gt;data&lt;/tag&gt;'
OUTPUT(decoded); // results in '<xml version 1><tag>data</tag>'

See Also: XMLDECODE