XMLDECOD: Decoding XML-Encoded Characters

How to:

The XMLDECOD function decodes the following five standard XML-encoded characters when they are encountered in a string:

Character Name

Character

XML-Encoded Representation

ampersand

&

&

greater than symbol

>

>

less than symbol

<

&lt;

double quotation mark

"

&quot;

single quotation mark (apostrophe)

'

&apos;



x
Syntax: How to Decode XML-Encoded Characters
XMLDECOD(inlength, source_string, outlength,  output)

where:

inlength

Integer

Is the length of the field containing the source character string or is a field that contains the length.

source_string

Alphanumeric

Is the name of the field containing the source character string or the string enclosed in single quotation marks (').

outlength

Integer

Is the length of the output character string or a field that contains the length.

output

Integer



Example: Decoding XML-Encoded Characters

XMLDECOD decodes XML-encoded characters and stores the output in a string with format A30:

XMLDECOD(30, INSTRING, 30, 'A30')

For &amp;, the result is &.

For &gt;, the result is >.


iWay Software