File Split
Why do we need a file split?
IM, like DSE, allows a file only to contain a certain number of documents (items respectively). The export will process all configured items but a post export step executing an xsl transformation is added at the end. The transformation will split the file every 100 documents and will attach header and footer in order to create a valid file. The files have the same name as configured in the export template but a consecutive number is added at the end.
The export templates you find in the resources package already have this post export step attached.
Configuration
If you create your own export templates or have adjusted one from prior versions, please add the xsl transformation to them.
This is how to configure the export:
Open the export template in the Export format templates perspective
Use a right click on the template to open the properties and select the tab Post-processing
Add a new post export step by selecting XSL transformation
You can change the name of the assigned post export step, e.g. XSL transformation (File split)Click on Manage files... to add the stylesheet.
Customization
If you need to adjust the number of documents in a file, do the following:
Get the corresponding stylesheet from the resources package. It can be found in the folder DataSource\<GDSN pool>\ExportTemplates\PostExport. In the following example the stylesheet "CR_CatalogueRequest_FileSplit.xslt" is used.
Adjust the for-each-group tag to use the desired number of documents
Stylesheet<xsl:stylesheet xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:n=
"http://www.1worldsync.com"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.1worldsync.com http://schemas.preprod.1worldsync.com/schemas/item/2.0/CatalogueRequestProxy.xsd"
version=
"2.0"
>
<xsl:param name=
"filename"
/>
<xsl:template match=
"/n:envelope"
>
<xsl:
for
-each-group select=
"catalogueRequest/document"
group-adjacent=
"(position()-1) idiv <Number-of-documents>"
>
Example<xsl:
for
-each-group select=
"catalogueRequest/document"
group-adjacent=
"(position()-1) idiv 100"
>
Add the changed stylesheet to your export template(s) as described above.