General description of Spool2XML

General description of Spool2XML

The normal printing process on the IBM i platform works like this:

Spl2XML_001

 

The printing program use a printer file to print the final spooled file. The use of an external printer file is a prerequisite for Spool2XML.

When introducing Spool2XML the new process looks like this:

Spl2XML_002

 

A short introduction to the individual parts:

 

The new Spool2XML printer file

Spl2XML_003

 

A new printer file is needed to ‘fool’ the program into creating a different spooled file. This is created by the command: IFORMNG2/CVTPRTFXML. In the XML definition you define the

output queue in which the final, merged spooled file will be generated, and if it should be broken up into smaller print outs. The new printer file can be placed higher in the library list or it

can replace the previous printer file. It is recommended to create the new printer file in another library.

 

The new XML Spooled file

Spl2XML_004

 

The XML spooled file contains the XML structure as it should be in the XML file. The XML data in the spooled file is written with a start and end tag for the record format printed and fields defined in the record format is written within start and end tags within this record format. So the XML structure is valid, but not structured in a heirarchy apart from this.

The output queue of the printer file must be one of the output queues, that is monitored by Spool2XML for automatic processing.

 

Convert the spooled file into XML

Spl2XML_005

 

The XML definition sets the structure of the final XML (what format is a sub-format to another - or in XML: Which formats are considered as subtrees to other formats?). It also sets the level

breaks to determine e.g. when a new XML files should be created (as one spooled file can be split up into many XML files).

 

Process the XML file in InterFormNG2

Spl2XML_006

 

The final step is to let InterFormNG merge the XML file with a template (selected in the XML definition) and create a new merged spooled file, a PDF, an email or whatever output you want.

    • Related Articles

    • XML Node Selection & Referencing

      XPath provides multiple ways to reference and navigate through an XML structure. Learn how to select specific nodes using direct references, index numbers, conditions, and relationships with other nodes. Connecting preceding or following node sets to ...
    • XML

      XML is used widely in InterFormNG2 as both input and output payload in the workflow (and of course in the designer). Please notice, that some workflow components are listed as accepting only XML as input, where they actually also accept an IBM i ...
    • Node Existence & Conditions

      XPath allows you to verify the existence of nodes, check if they contain data, count occurrences, and ignore namespaces. This section covers essential techniques for validating and filtering XML elements. Calculating the sum of nodes Counting ...
    • Split spool (complex key)

      A spooled file can be split into smaller files depending on the contents e.g. to split up a larger spooled file with many invoices into individual invoices. If the other spooled file split functions are not enough, then you can consider this workflow ...
    • Rule-based XML validation

      This advanced validation workflow component, Rule-based XML validation, can validate XML according to rules. The rules for rule-based validation can be used to validate documents in XML format. A suggestion for implementation can be found here. The ...