Use XSL transformation to map metadata and XML data

Kofax Import Connector can parse incoming XML documents and/or the metadata of incoming messages and use the information from them to populate message fields. XML documents can also include links to other documents to be imported. There are three types of mapping:

  • XML Import Connector compatible: Specific variant of the generic mapping. It is compatible with the Kofax Capture XML Import Connector. It is only available if you select ImportSession as the XML type for the destination. It maps the input XML data in the same way as XML Import Connector.

  • Simple mapping: Maps metadata and/or XML document data to the particular fields of the batch/folder/document classes that are configured for the destination where the mapping occurs. It is not possible to control the batch/folder/document class names through the input XML data.

  • Generic mapping: Takes into account that the information on batch/folder/document classes may come in along within the customer’s XML document (and the class names configured for the destination are only used as fallback if the particular class name is missing). The XML format in generic mapping is not restricted and it can be configured for virtually any customer XML data structures.

The mapping (for both simple and generic methods as well) is performed by means of an XSL transformation. The transformation file can be written manually by an XSLT expert or can be generated by any XML mapping visual tool (such as, Altova MapForce). These tools offer a user-friendly GUI that can perform even complex XML mappings and the XSL transformation can be generated automatically.

Important In this document, Altova MapForce tool is used to describe all XSL transformation. You can use any other tool. This tool can be installed on any computer. Kofax Import Connector does not need this tool at run time.

Prerequisite: You can write the XSL transformation file manually or can generate it using any XML mapping visual tool, such as Altova MapForce. Still, XSLT expertise is required to perform XML mapping.

  1. Before setting up XML mapping, at least one XML type must be defined; unless you are using the XML Import Connector schema <ImportSession> - that is available automatically. See XML types.
    Note You do not need to specify an XML type if you only want to map document metadata.
  2. Edit a destination. See Destinations Tasks
  3. On the Import settings tab, select an XML Type (not necessary if you only want to map document metadata).
  4. On the Import mappings tab, configure XML mapping:
    • XML Import Connector compatible: For XML documents compatible with Kofax Capture XML Import Connector. Continue with step 12.

    • Simple: To map XML data and message metadata to the batch/folder/document fields assigned to the destination that you are currently editing.

    • Generic: If the information about batch/folder/document classes is included in the XML document. The information from the XML overrides the destination settings. If the class names are not specified in the XML, the settings of the destination are used. Generic is also necessary in the following use cases:

      • Kofax Tables should be filled with the content of the input XML

      • The content of any index field should be evaluated by an expression

      • Other features possibly supported by the Kofax XML Import Connector format

  5. Click Show files for Visual Designer to display the folder where Kofax Import Connector stores the files required for mapping.
    Note It is the same folder that contains the files for XML rendering.
  6. If Altova MapForce is not installed locally, copy the entire folder to the Altova MapForce computer.
  7. Open the .mfd project file in Altova MapForce.
  8. Map XML data and metadata to Kofax Capture batch / folder / document fields.

    Altova MapForce screen shot

  9. Save the project file. On the File menu, click Save.
  10. Save the result to an XSLT file. On the File menu, expand Generate code in and select XSLT 1.0. You must save the file to the same directory where the .mfd file is located. Change the file name to XmlMapping.xslt.
  11. If Altova MapForce is not installed locally, copy the entire folder back to KC Plug-In computer (to the original location).
  12. Close the destination configuration window and restart KC Plug-In.

You can use other tools to generate the necessary XSL transformation file that governs metadata mapping. Simple transformations can also be written using a text editor. Alternatively, you can also contact Kofax to create the mapping for you. For additional information, refer to the Kofax Import Connector Developers Guide.

Note When using the XML type "ImportSession", you do not need to create any XSL transformation. The mapping is available automatically.

There is a significant difference in importing of document's body and attachments (including XML document itself) between simple and generic mapping:

  • With simple mapping all parts of a document are automatically handled according to the destination’s configuration and then imported as pages in the same folder/document class (or loose pages) of the batch. If you convert your content to TIF or PDF and select Include original content, the XML document is imported as original XML and also rendered to TIF or PDF. Further, if you do not convert the content and select Include original content, the original XML document is imported.

  • With the XML Import Connector compatible generic mapping, the attachments are only imported if they are explicitly linked in the XML file. The controlling XML file is never imported.

  • When using the generic mapping, attachments (and the XML document itself) are only imported if explicitly instructed in the XSL transformation. For additional information, refer to the Kofax Import Connector Developer's Guide.

Altova MapForce is a third-party software that requires a license. This software is not included with Kofax Import Connector. Also, the licenses for Kofax Import Connector will not help you operating Altova MapForce.