XSLT file

When you use the Adapter for File System (XSLT) activity, the XSLT file specifies how to transform the XML structure of the XBOUND root document into the target structure of the output.

Advanced actions can also be defined. For example, directories, TAR files, and single-page TIFF media can be exported. (See XSLT extension functions).

These parameters are available:

XBOUNDElementNode

When the process step is called, this parameter is given the current initial node. In most cases this is the "document" element of the root document. The initial node can represent a root document with several invoices, for example.

tempDir

Contains the temp directory that was configured in the parameter set, or the export base directory if no temp directory was configured.

Defining the export file name

Define the export file name by calling the XSLT extension function SetFileName, with the desired name and the path (relative or absolute) of the export file. If you specify a relative path, the configured base directory is used as the root.

Example of an XSLT file

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

<!-- Declare extension functions "xboundCustomFunctions" -->

<xsl:stylesheet version="1.0"

        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

        xmlns:xboundCustomFunctions="urn:xboundCustomFunctions"

        xmlns:fun="8B9C63F4-F4AB5D11-994A0001-B4CD626F"

        extension-element-prefixes="xboundCustomFunctions fun"

        exclude-result-prefixes="xboundCustomFunctions">

  <!--Creating an HTML file with UTF 8 encoding

      and formatting-->

  <xsl:output method="html" encoding="UTF-8" indent="yes"/>

  <!-- Is initialized by XBOUND to an element of the root document

       (document, medium, field) and is used for selecting

       of the desired batch section -->

  <xsl:param name="xboundElementNode"/>

  <!-- Is initialized by XBOUND to the configured

  export directory -->

  <xsl:param name="tempDir"/>

  <!-- Entry template, will be called first-->

  <xsl:template match="/">

    <html>

    <body>

      <!-- Call "field" template, for each field found

           for the $xboundElementNode document -->

      <xsl:apply-templates select="$xboundElementNode/field"/>

    </body>

    </html>

  </xsl:template>

  <!-- Templates for field output -->

  <xsl:template match="field">

    <!-- creates a paragraph with name and value of the field

         separated by ": " -->

    <p>

      <xsl:value-of select="@name"/>: <xsl:value-of select="@value"/>

    </p>

  </xsl:template>

</xsl:stylesheet>

XML batch structure

The XSLT Script Editor