Please enable JavaScript to view this site.

InterFormNG2 Manual

Navigation: Spooled file support > Spooled files in the workflow

Transform a spooled file into XML

Scroll Prev Top Next More

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.