The normal printing process on the IBM i platform works like this:
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:
A short introduction to the individual parts:
A new printer file is needed to ‘fool’ the program into creating a different spooled file. This is created by the command: IFORMNG/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 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.
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).
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.