Transform a spooled file into XML

Transform a spooled file into XML

InterFormNG2 can help you to transform a spooled file into XML. 

In order to do that you first need to load the spooled file in the library in the version 2 format.   

Next you need to setup a transformation of the spooled file in the designer. This will be saved as a special template with the extension, .ixt.


In this section you can also find information about:

1.How to convert an .ixt transformation template into an .xsl transformation e.g. for advanced transformations.

2.How to use an .xsl transformation on an input spooled file.

  

How to convert a .ixt transformation template into an .xsl transformation

The transformations, that you can create with transformation designer and .ixt is a bit limited, so if you hit such a limitation, then you can chose to convert the .ixt template into an xsl transformation. 

In order to transform an .ixt file into an .xsl file, then you need to trigger a workflow, that can do the job for you.

In the workflow you can now choose to transform the spooled file into XML with the workflow component, XSL transformation on SPLFV2 and save the transformed file either as a resource or as a file.

The initial payload is irrelevant as it is overwritten by this component.

Such a workflow could look like this: 

NG2IXT2XSL0001

 

With these components:

 

NG2IXT2XSL0002

 

NG2IXT2XSL0003

 

NG2IXT2XSL0004

 

So with the workflow above you can e.g. convert an ixt file for a spooled file with this header:

NG2IXT2XSL0005

Each of these fields are converted into XML nodes with this ixt template:

NG2IXT2XSL0006

 

This xsl transformation is created with the conversion of the .ixt template:

 

NG2IXT2XSL0007

 

How to use an .xsl transform on a spooled file

A spooled file is in InterFormNG2 stored as an xml file, so it is possible to use an XSL transformation on spooled files e.g. in order to convert them into an XML file or many other output formats.

The only challenge is, that a spooled file is stored in the payload as a document type .splf, which does not fit with the transformations as a transformation require that the payload is XML.

You can however overrule the payload type in the workflow to explicitly force the workflow to handle the payload as a different document type. You can force this with the workflow component, Force content type.

With that component you can setup the workflow as below:

 

NG2IXT2XSL0008

 

In this example we use these workflow components:

Read from file. This would normally be replaced with From IBM i output queue.

Force content type. Here we set the payload to be XML.

XSL transformation. Transforms the spooled file into an XML.

To filesystem. Stores the converted XML file. This could e.g. also be replaced with Save in resources e.g. to save the XML file as a document inside the InterFormNG2 library.


    • Related Articles

    • 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 ...
    • Spooled file support

      InterFormNG2 is able to process spooled files, if you install InterFormNG2 on the IBM i platform. Please notice, that spooled file support, as well as Spool2XML, are modules for InterFormNG2, that are purchased separately. You can also use the ...
    • Spooled file multi-Up

      It is possible in InterFormNG2 to convert multiple input spooled file pages into a single output page. This is often referred to as either Multi-Up or pages per side. A classic example of multi-up is this kind of output, where we have chosen to put 4 ...
    • Transform or split

      Transform or split : The transform or split workflow component is able to transform and/or split an input XML file. The subtree of this workflow component is executed for each splitted/transformed XML. A similar component is the Split XML component, ...
    • Restore a spooled file

      With InterFormNG2 you restore a spooled file in two manners: 1.You can download a loaded spooled file from the InterFormNG2 library, and upload it into the library (same procedure as an XML file) of another InterFormNG2 installation e.g. on a windows ...