bpi.xmlencode()

 bpi.xmlencode()

This subroutine is provided to allow cross-platform (unidata/uniVerse/etc) read path capability. The subroutine allows the developer to target a specific file  by path and it will return the content of that file in the return variable.

Subroutine Syntax

CALL bpi.xmlencode( in, out, target, error )

Parameters

Param

Direction

Description

in

passed

This is an inbound string or array to be xmlencoded.  Note, multivalue delimiters such as @AM will be unchanged so it is okay to pass an array to this subroutine.

out

returned

This is an outbound string or array that is an xmlencoded form of the 'in' variable.

target

passed

This specifies the scope of the XML encoding.  Valid values are:

   

all

The characters & " ' < > will be encoded
   

nocontainers

only & ' and " will be encoded
   

dataonly

on the characters & ' and " will be encoded
      (blank) will default to 'all'
    You may also pass in the specific character you wish to have encoded into the target param.  The valid characters to pass are & " ' < >
error returned If no error is encountered, the routine will return a zero.  Otherwise, it will return an error code.  Currently, there are no error codes returned.

 Example

myArray                = \\
myArray<name> = \Bruce & Dave\ ; *will be changed from & to &amp
myArray<favoriteQuote> = \He ain't heavy, he's my brother\ ; *will be changedchange ' to &apos
CALL bpi.xmlencode( myArray, encodedArray,\all\, error)
CRT \My xmlencoded array is: \:encodedArray