XMLSCRUB Function

Purpose

Clears out the CHARACTER source buffer, substituting strings for special characters, and returning a value indicating the number of bytes put into the target buffer.

Syntax

XMLSCRUB(p,m,q,n)

Parameters

p
The address of the target buffer.
Note: When this value is 0 (zero), XMLSCRUB returns the number of bytes to be written.
m
The non-negative length of the target buffer in bytes. The buffer length must have a computational type. It is converted to FIXED BINARY(31,0).
Note: When this value is not large enough to accommodate the data, XMLSCRUB returns a value of -1. When this value is large enough to accommodate the data, XMLSCRUB returns the number of bytes written to the buffer.
q
The address of the source buffer.
n
The non-negative length of the source buffer in bytes. The buffer length must have a computational type. It is converted to FIXED BINARY(31,0).

Description

The XMLSCRUB function cleans out the source buffer. All characters less than a blank are replaced with a blank except for the following:

  • \t
  • \n
  • \r

In addition, XMLSCRUB substitutes the following strings for the corresponding special characters:

String Special character
" "
' '
& &
&lt; <
&gt; >
&#xD; carriage return

Restrictions

None.