In this section: |
To handle large files, iWay Service Manager provides a streaming interface. You can use streaming preparsers only with the HTTP, File, and JMS adapters. To use a streaming preparser in conjunction with other preparsers, you must define it as the first preparser in the chain. The following streaming preparsers are available:
Syntax:
com.ibi.preparsers.XDXMLStreamPreParser
The Concatenated XML Document Stream preparser accepts input files containing multiple XML documents and creates single XML documents from the original input file.
For example, this preparser can process the following batch of XML documents:
<?xml version="1.0" encoding="UTF-8"?> <hi>This is my document</hi> <hi>This is my document</hi> <hi>This is my document</hi> <hi>This is my document</hi>
To define a Concatenated XML Document Stream preparser:
The Preparsers pane opens.
The preparser is added to the list in the Preparsers pane.
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.
Syntax:
com.ibi.preparsers.XDDelValStream
Description:
The Delimited Value Stream preparser is a delimited value handler, which is useful when the incoming message consists of a delimited value stream such as lines of comma separated values. The first line can optionally hold field names (DIF format input). An XML document is generated from the input with a child node of each row, and children of that row in turn for each value.
In a use case scenario, the Delimited Value Stream preparser can be used when an incoming message consists of a batch of flat files that are delimited by a special character, such as '|'. This message also needs to be converted to XML format.
Parameters:
Parameter | Description |
---|---|
Root name * | The element name of the outer tag. |
Dif * | Determines whether the first line should be treated as an element name. |
Delimiter * | Determines the delimiter to be used. Select comma or tab from the drop-down list, or enter a specific character in the field. |
Rows | The number of rows in each document. |
Trim values | Determines whether all values should be trimmed. |
Header | Determines whether the first line shouuld be ignored. |
Quotes | Determines whether surrounding quotes should be eliminated. |
Empty elements | Determines whether empty elements at the 'right' should be eliminated. |
Example:
The configuration parameters pane opens.
The name and description pane opens.
02|penny|copper|$0.01 03|one dollar|paper|$1.00 04|five dollars|paper|$5.00 05|ten dollars|paper|$10.00 06|twenty dollars|paper|$20.00
When this input document is processed by the channel, an output XML document is generated with the following contents:
<?xml version="1.0" encoding="ISO-8859-1" ?><testroot RowCount="4"><row rowcnt="1"><_nb02>03</_nb02><penny>one dollar</penny><copper>paper</copper><_dlr0.01>$1.00</_dlr0.01></row><row rowcnt="2"><_nb02>04</_nb02><penny>five dollars</penny><copper>paper</copper><_dlr0.01>$5.00</_dlr0.01></row><row rowcnt="3"><_nb02>05</_nb02><penny>ten dollars</penny><copper>paper</copper><_dlr0.01>$10.00</_dlr0.01></row><row rowcnt="4"><_nb02>06</_nb02><penny>twenty dollars</penny><copper>paper</copper><_dlr0.01>$20.00</_dlr0.01></row></testroot>
Syntax:
com.ibi.preparsers.XDFlatStreamPreParser
Description:
The Flat Stream preparser is used to split non-XML messages based on a recognized character. During configuration, the character can be specified as any character, a special character, or a HEX character.
The Flat Stream preparser is useful when handling individual lines of a large, delimited file.
Parameters:
Parameter | Description |
---|---|
Delimiters | List of possible delimiters (default is new line). Possible values include:
|
Example:
The configuration parameters pane opens.
The name and description pane opens.
First Line Second Line Third Line Fourth Line
When this input document is processed by the channel, the output document (document2_1.txt) contains the following:
<?xml version="1.0" encoding="ISO-8859-1" ?><testroot>First Line</testroot>
The output document (document2_2.txt) contains the following:
<?xml version="1.0" encoding="ISO-8859-1" ?><testroot>Second Line</testroot>
The remaining output follows the same format.
iWay Software |