#### XML

#### Synopsis

    HELP:   Read XML data from memory
    TYPE:   OBJECT
    SYNTAX: XML(BLKSIZE=num,NOCMNT,NODFLT,NOEMPD,ADDEMP,NOPINS,NODTD,CCDATA,DATLEN=num,LENERR,CCSID='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,CHRMODE=STOP/IGNORE/SUBSTITUTE/IDENTITY/TRANSLIT,SKIPEQUAL,USRTABLE='str'/NPAS/SEPA/DELA/DLAX,ONEMAP,COMBINED=NFD/NFC/AUTO/ON/OFF,BOM,KEEPBOM,ENL2LF,DECRYPT[{}...],AVSCAN())

#### Description

Format XML reads a byte stream and parses the data into XML elements. Before parsing takes place, the data must be converted to UTF-8 unless it is already in UTF-8 or ASCII. Line delimiters must be one of 0x0A, 0x0D or 0x0D0A. During parsing, all line delimiters are normalized to line feed characters (0xA) as defined by the XML specification.

If a CCSID is provided, the character data will be converted from the provided CCSID to UTF-8. If no CCSID is provided, no character conversion will be done.

During character conversion, the following options are supported:

- Stop, ignore or substitution of invalid or incomplete characters
- A custom substitution character list
- Different system substitution / transliteration tables
- A user-defined substitution table to override the system tables
- Case management (upper, lower, folding and special casing)
- Transliteration between subsets (mapping) and normalization
- BOM management and automatic detection of character sets
- Reporting of ignored or substituted characters
- Auto detection of charsets

#### Arguments

- `SWITCH: NOCMNT - Ignore XML comments [FALSE]`
- `SWITCH: NODFLT - Ignore XML default elements (i.e. whitespace before/after root tag) [FALSE]`
- `SWITCH: NOEMPD - Ignore XML empty/whitespace data elements (not in CDATA section) [FALSE]`
- `SWITCH: ADDEMP - Add an empty XML data element if end tag follows direct a start tag [FALSE]`
- `SWITCH: NOPINS - Ignore XML processing instructions [FALSE]`
- `SWITCH: NODTD - Ignore XML document type definitions[FALSE]`
- `SWITCH: CCDATA - Collect CDATA to simple data elements [FALSE]`
- `NUMBER: DATLEN=num - Minimum length to collect data elements in one element [1024]`
- `SWITCH: LENERR - Return an error if minimum data element length exceeded [FALSE]`
- `SWITCH: SKIPEQUAL - Skip conversion if formats are equal (e.g. UTF-8 to UTF-8)`
- `SWITCH: KEEPBOM - Keep byte order mark for faster conversion`