We defined a simple split of the Intro_demo.xml file here. This resulted in 3 files, which contained the data from the detail path (Split Xpath Expression), but not the parents of this, so you could not see which customer each invoice belongs to. You can see the original xml file here. Here you may notice the ‘header nodes’ prior to the first document. These header nodes are missing in the splitted xml files created.
For the Intro_demo.xml file, which is included in InterFormNG inside {INTERFORMNG_HOME}/resources/documents/Intro you can also split up this for each Document node. This is done with this path:
Using this xslt creates one xml file for each document - including the information from the parent node:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="detail"/>
<xsl:template match="/">
<Root>
<xsl:copy-of select="$detail/parent::*/CompanyInfo"/>
<xsl:copy-of select="$detail/parent::*/Greeting"/>
<xsl:copy-of select="$detail/parent::*/Barcode"/>
<xsl:copy-of select="$detail"/>
</Root>
</xsl:template>
</xsl:stylesheet>