Skip to main content
Kofax

XML Export Connector XSLT Support

21547
308720

Question / Problem: 

The Export Connector for XML 8.0 supports implementation of an XSLT file for transforming the exported XML to a different format.
What is the default XML format from this Export Connector, and are there any examples of a typical XSLT file that can be used with this Export Connector?

Answer / Solution: 

Below is an XML output file exported from the XML Export Connector; this is the default format. In this case we have a typical check:

<?xml version="1.0" encoding="UTF-8"?>
<DOCUMENT>
   <EXTERNALFILES>
     <PRIMARYFILE FileName="C:\MSSB\POC\Exports\3e5bfc43-dca4-4e2a-890d-a5bd00a091a2\118809-24-2001031100092.TIF"/>
   </EXTERNALFILES>
   <OCRTEXTFILES/>
   <DOCUMENTINDEX Name="A2iA_CheckAmount"> 1087.03</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckCAR"> 1087.03</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckCodeline_OnUs1"> 28557833</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckCodeline_Transit"> 031100092</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckDate"> 09-24-2001</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckLAR"> 1087.03</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckNumber"> 1188</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="A2iA_CheckPayeeName"> GE CAPITAL</DOCUMENTINDEX>
   <DOCUMENTINDEX Name="CheckPayerName"> SOFTPRO NORTH AMERICA, INC.</DOCUMENTINDEX>
</DOCUMENT>

Now we want to convert this data to a different format, as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Document>  
  <FileName>C:\MSSB\POC\Exports\13f78581-1501-4dd0-8cf3-a5a300ba4083\121110-26-2001031100092.TIF</FileName>  
  <A2iA_CheckAmount> 3304.49</A2iA_CheckAmount>
  <A2iA_CheckCAR> 3304.49</A2iA_CheckCAR>
  <A2iA_CheckCodeline_OnUs1> 28557833</A2iA_CheckCodeline_OnUs1>
  <A2iA_CheckCodeline_Transit> 031100092</A2iA_CheckCodeline_Transit>
  <A2iA_CheckDate> 10-26-2001 </A2iA_CheckDate>
  <A2iA_CheckLAR> 3304.49</A2iA_CheckLAR>
  <A2iA_CheckNumber> 1211</A2iA_CheckNumber>
  <A2iA_CheckPayeeName> BCBSD</A2iA_CheckPayeeName>
  <CheckPayerName> SOFTPRO NORTH AMERICA, INC.</CheckPayerName>
</Document>

To perform the required transformation, the following XSLT can be used:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
   <xsl:template match="/DOCUMENT">
      <xsl:element name="Document">
         <xsl:apply-templates />
      </xsl:element>
   </xsl:template>
   <xsl:template match="EXTERNALFILES/PRIMARYFILE">
      <xsl:element name="FileName">
         <xsl:value-of select="@FileName"/>
      </xsl:element>
   </xsl:template>
   <xsl:template match="DOCUMENTINDEX">
      <xsl:element name="{@Name}">
         <xsl:value-of select="text()" />
      </xsl:element>
   </xsl:template>
</xsl:stylesheet>

 

Applies to:  

Product Version Category
KEC 8.0 Configuration

 

Author:  Michael Robertson