Preparsers

Topics:

Many preparsers are available to assist you in preparing message flows. Some common ones are described in this section.

Append

Class name: XDAppend

Adds constant text to the head and/or tail of the incoming message. This preparser is often useful in adding XML tags around messages.

DelVal

Class name: XDDelVal

Delimited value handler. Useful when the incoming message is 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.

Entag

Class name: XDEntag

Surrounds the incoming message with a designated tag. Optionally passes on the incoming message as CDATA to the tag. Additional features allow configuration of attributes including source, message ID, and correlation ID.

ErrorFilter

This preparser operates on iWay error documents. Error documents are a standard by which iWay Service Manager reports errors back to the user. These documents contain the complete incoming message associated with the error. The preparser extracts the original message and passes it into the system for processing.

Messages identified as not being error documents are passed on as is.

MultiPart

Class name: XDMultiPart

Divides multipart documents for later use. This preparser must be last in the chain. When used, the multipart message is broken up so that the body of the multipart message is part 0 and subsequent attachments are 1 to n. The multipart object is carried in the XDDocument and can be retrieved and interrogated by your own business agent to obtain the individual parts for processing. If the body is a MIME type of _/XML, it is parsed and carried as an XML document.

PGPDecrypt

Operates on the text of a PGP-encrypted message to decrypt it for use. The preparser accepts either a passphrase or uses a registered keyring for key purposes. The configuration determines whether the document is to be treated as XML or flat once it emerges from the preparser.

Replace Characters

Characters are replaced on a one-for-one basis. Each character in the input specification is replaced with the parallel character in the output specification.

Characters can be specified as simple characters such as %, standard encoding (\n, \t), or by using a hex specification, such as \x05. For example, to replace the carriage return (hex 0d) and the tab characters with the letter x, the specification would be:

input

\x0d\t

replace

xx