Please enable JavaScript to view this site.

InterFormNG Manual 2020

If the input xml file is not sorted on the element, that you would like, then you can even use an xslt stylesheet in the transform to sort the input xml file and process the new, sorted xml file instead. The demo xml file, intro_demo.xml found in {INTERFORMNG_HOME}\resouces\document\Intro contains e.g. 3 document nodes with a unique DocumentNo element inside. The sequence of these is:

 

1004

1001

1003

 

But it is possible to sort this sequence and still keep the complete structure. This is possible if you define an xslt transform file with the contents below:

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

 

   <xsl:template match="/">

 <Root>

       <xsl:copy-of select="/Root/CompanyInfo"/>

          <xsl:for-each select="/Root/Document">

               <xsl:sort select="DocumentNo"/>
               <Document>
                       <xsl:copy-of select="*"/>
               </Document>

          </xsl:for-each>

 </Root>

   </xsl:template>

 

</xsl:stylesheet>

 

With this the new sequence is (of course):

 

1001

1003

1004