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:

  1. Open the export template in the Export format templates perspective

  2. Use a right click on the template to open the properties and select the tab Post-processing

    images/download/attachments/417937335/Export-properties.png

  3. 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)

  4. Click on Manage files... to add the stylesheet.

    images/download/attachments/417937335/image2020-5-5_20-51-20.png

Customization

If you need to adjust the number of documents in a file, do the following:

  1. 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.

  2. 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">
  3. Add the changed stylesheet to your export template(s) as described above.