In this section: |
Splitter preparsers divide an incoming document into smaller pieces based on a specified delimiter. The incoming document could be an XMl document or a flat file. Different preparsers handle different types of incoming documents. All streaming preparsers are splitter preparsers, but all splitter preparsers are not streaming preparsers. The following splitter preparsers are available:
Syntax:
com.ibi.preparsers.XDDelVal
Description:
The Delimited Value 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 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. |
Trim values | Determines whether all values should be trimmed. |
Quotes | Determines whether surrounding quotes should be eliminated. |
Empty elements | Determines whether empty elements at the 'right' should be eliminated. |
Include blanks * | Determines whether a blank line should be treated as a row with all null elements, or ignored. |
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.XDXMLSplit
Description:
The XML Splitter preparser is used to divide an incoming XML document into smaller documents at a specified, repeating child.
In a use case scenario, if the incoming XML document is large and has repeating segments, this document could be divided into smaller pieces to improve the speed at which messages are processed.
Parameters:
Parameter | Description |
---|---|
Level string * | Define in dot of slash notation, the path to the element on which to split. An asterisk character (*) specifies any tag at that element. |
Sequence | If set to true, a count attribute is set into each root. |
Example:
The configuration parameters pane opens.
The name and description pane opens.
<a> <b name="b1"> <c>value of input element a/b@name=b1/c is 1</c> <c>value of input element a/b@name=b1/c is 2</c> </b> <b name="b2"> <c>value of input element a/b@name=b2/c is 3</c> <c>value of input element a/b@name=b2/c is 4</c> </b> </a>
When this input document is processed by the channel, the following output XML documents are generated:
<?xml version="1.0" encoding="ISO-8859-1" ?><a><b name="b1"><c>value of input element a/b@name=b1/c is 1</c><c>value of input element a/b@name=b1/c is 2</c></b></a>
<?xml version="1.0" encoding="ISO-8859-1" ?><a><b name="b2"><c>value of input element a/b@name=b2/c is 3</c><c>value of input element a/b@name=b2/c is 4</c></b></a>
<?xml version="1.0" encoding="ISO-8859-1" ?><batch>EOT</batch>
iWay Software |