Splitter Preparsers

In this section:

Splitting is performed by preparsers. A splitting preparser must be the first user-configured preparser. Splitting preparsers are provided for XML, non-XML, and EDI messages.


Top of page

x
EDISplit

Class name: EDISplitPP

Splits EDI documents on ST segments. Each split subdocument is passed to a transform for conversion to XML.


Top of page

x
FlatSplit

Class name: XDFlatStreamPreParser

Splits non-XML messages that are to be split on a recognized character. The configuration specifies the split character - default is the end of line for the platform. The character can be specified as any character, a special character, or a hex character.

Character

Description

X

Any character

\n

New line

\r

Carriage return

\t

Tab

\xab

Ab are hex characters such as 0A.

A standard use of this preparser is to handle individual lines of a large, delimited file.



x
XMLSplit

Class name: XDXMLStreamPreParser

The incoming XML document is divided into smaller documents, broken at a specified repeating child. For example:

<a>
 <b>
  <c>one</c
 </b>
 <b>
  <c>two</c>
 </b>
</a>

With a split specified as a/b, it results in three passes through the configured flow.

Pass 1

<a>
 <b>
  <c>one</c>
 </b>
</a>

Pass 2

<a>
 <b>
  <c>two</c>
 </b>
</a>

Pass 3

No data.

getStreamState() is STREAM_EOS and special register eos is defined as 1.


Top of page

x
DelValSplit

Class name: XDDelValStream

Operates in the same manner as the delimited values preparser DelVal. One or more rows of delimited values are emitted as a tree, until the input is exhausted.

Example: Input file

One,Two,Three
10,20,30
100,200,300

Setting for one row per pass with a root of tree yields:

Pass 1

<tree>
<One>10</One>
<Two>20</Two>
<Three>30</Three>
<tree> 

Pass 2

<tree>
<One>100</One>
<Two>200</Two>
<Three>300</Three>
<tree>

Pass 3

No data.

getStreamState() is STREAM_EOS and special register eos is defined as 1.


iWay Software