Section - 5 : Transforming XML Files
You can export an XML file with XSLT transformation. This lets you transform the output XML file into another format, such as HTML or text. The final output format is determined by the XSLT template you choose.
The system transforms an export file with the XSLTW32.EXE program using the XSL template you specified with the XSLTName option.
To enable the export, add this option to the ExportFormats control group:
< ExportFormats >
01 =;Mx;Export with XSL;WXMW32->WXMExportWithXSL
Then add these options:
< ExportWithXSL >
XSLTName =
Executable =
Debug =
Option | Description |
---|---|
XSLTName | The full or relative path and name of the XSLT template. |
Executable | (Optional) The full path and name of the program. If omitted, the system looks for the XSLTW32.EXE program in the directory where the AFEMNW32.EXE program is located. |
Debug | (Optional) Enter Yes to leave temporary files in place. |
Note: The default control group used by the WXMExportWithXSL rule is the ExportWithXSL control group. If you specify another control group and one of its options are missing, the system uses the values from the ExportWithXSL control group.
You can define several INI options in the ExportFormats control group if you want to display multiple output processing options, each with its own XSL template. Here is an example:
< ExportFormats >
01 =;M1;Export with XSL;WXMW32->WXMExportWithXSL
02 =;M2;Export with XSL;WXMW32->WXMExportWithXSL
Each option listed under the ExportFormats control group requires a matching ExportWithXSL control group:
< ExportWithXSL:M1 >
XSLTName =
Executable =
Debug =
< ExportWithXSL:M2 >
XSLTName =
Executable =
Debug =
Appending output transformations
You can append multiple XSLT output transformations to the same file using this INI option:
< ExpFile_CD >
AppendedExport = Yes
This example transforms an XML export into a semicolon-delimited output file you can import into Excel. It also uses the XSLTW32.EXE program for the transformation.
First, you need these INI options:
< ExportFormats >
01 =;M1;Export with XSL;WXMW32->WXMExportWithXSL
< ExportWithXSL:M1 >
XSLTName = x:\rp\mstrres\aeic\xsl\output1.xsl
Executable =
Debug = No
And this XSL style sheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" encoding="ISO-8859-1" />
<!-- global variables -->
<xsl:template match="/">
<xsl:call-template name="process"/>
</xsl:template>
<xsl:template name="process">
<xsl:variable name="semicolon" select="';'"/>
<xsl:variable name="root" select="DOCUMENT/DOCSET"/>
<xsl:variable name="policy" select="$root/
FIELD[@NAME='POLICY']"/>
<xsl:variable name="insnam" select="$root/
FIELD[@NAME='INSNAM']"/>
<xsl:variable name="insnam2" select="$root/
FIELD[@NAME='INSNAM2']"/>
<xsl:variable name="insad1" select="$root/
FIELD[@NAME='INSAD1']"/>
<xsl:variable name="insad2" select="$root/
FIELD[@NAME='INSAD2']"/>
<xsl:variable name="inszip" select="$root/
FIELD[@NAME='INSZIP']"/>
<xsl:variable name="agent" select="$root/
FIELD[@NAME='AGENT']"/>
<xsl:variable name="effdte" select="$root/
FIELD[@NAME='EFFDTE']"/>
<xsl:variable name="expdte" select="$root/
FIELD[@NAME='EXPDTE']"/>
<xsl:variable name="cddesc" select="$root/
FIELD[@NAME='CDDESC_BUSDSC']"/>
<xsl:variable name="premo_prop" select="$root/
FIELD[@NAME='PREMO_PROP']"/>
<xsl:variable name="advprem" select="$root/
FIELD[@NAME='ADVPREM']"/>
<xsl:variable name="totpre" select="$root/
FIELD[@NAME='TOTPRE']"/>
<xsl:variable name="galmt" select="$root/
FIELD[@NAME='GALMT']"/>
<xsl:variable name="prcolmt" select="$root/
FIELD[@NAME='PRCOLMT']"/>
<xsl:variable name="pailmt" select="$root/
FIELD[@NAME='PAILMT']"/>
<xsl:variable name="perocc" select="$root/
FIELD[@NAME='PEROCC']"/>
<xsl:variable name="fdlmt" select="$root/
FIELD[@NAME='FDLMT']"/>
<xsl:variable name="medlmt" select="$root/
FIELD[@NAME='MEDLMT']"/>
<xsl:value-of select="concat($policy, $semicolon)"/>
<xsl:value-of select="concat($insnam, $semicolon)"/>
<xsl:value-of select="concat($insnam2, $semicolon)"/>
<xsl:value-of select="concat($insad1, $semicolon)"/>
<xsl:value-of select="concat($insad2, $semicolon)"/>
<xsl:value-of select="concat($inszip, $semicolon)"/>
<xsl:value-of select="concat($agent, $semicolon)"/>
<xsl:value-of select="concat($effdte, $semicolon)"/>
<xsl:value-of select="concat($expdte, $semicolon)"/>
<xsl:value-of select="concat($cddesc, $semicolon)"/>
<xsl:value-of select="concat($premo_prop, $semicolon)"/>
<xsl:value-of select="concat($advprem, $semicolon)"/>
<xsl:value-of select="concat($totpre, $semicolon)"/>
<xsl:value-of select="concat($galmt, $semicolon)"/>
<xsl:value-of select="concat($prcolmt, $semicolon)"/>
<xsl:value-of select="concat($pailmt, $semicolon)"/>
<xsl:value-of select="concat($perocc, $semicolon)"/>
<xsl:value-of select="concat($fdlmt, $semicolon)"/>
<xsl:value-of select="concat($medlmt, $semicolon)"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
And this XML export file:
<?xml version="1.0" encoding="UTF-8" ?>
- <DOCUMENT TYPE="RPWIP" VERSION="10.3">
- <DOCSET NAME="">
<FIELD NAME="POLICY">A108</FIELD>
<FIELD NAME="INSNAM">SAM MALONE</FIELD>
<FIELD NAME="INSNAM2">CHEERS, INC.</FIELD>
<FIELD NAME="NEW">X</FIELD>
<FIELD NAME="INSAD1">123 MAIN ST</FIELD>
<FIELD NAME="INSAD2">SUITE 100</FIELD>
<FIELD NAME="INSCTY">ATLANTA</FIELD>
<FIELD NAME="INSST">GA</FIELD>
<FIELD NAME="INSZIP">23033</FIELD>
<FIELD NAME="AGENT">12345</FIELD>
<FIELD NAME="AGYNAM">Docucorp Insurance Agency</FIELD>
<FIELD NAME="AGYAD1">2727 Paces Ferry Road S.E.</FIELD>
<FIELD NAME="AGYAD2">Suite II-900</FIELD>
<FIELD NAME="AGYCTY">Atlanta</FIELD>
<FIELD NAME="AGYST">GA</FIELD>
<FIELD NAME="AGYZIP">30339</FIELD>
<FIELD NAME="PRMSTE">GA</FIELD>
<FIELD NAME="EFFDTE">07/05/2003</FIELD>
<FIELD NAME="EXPDTE">07/05/2004</FIELD>
<FIELD NAME="TERM">366 DAYS</FIELD>
<FIELD NAME="CDDESC_BUSDSC">BAR & GRILL</FIELD>
<FIELD NAME="PREMO_PROP">12,000.00</FIELD>
<FIELD NAME="ADVPREM">12,000.00</FIELD>
<FIELD NAME="FEEDESC1">Policy Tax</FIELD>
<FIELD NAME="FEEDESC1 TAX">3%</FIELD>
<FIELD NAME="FEEAMT1">360.00</FIELD>
<FIELD NAME="FEEDESC2">Stamping Fee</FIELD>
<FIELD NAME="FEEAMT2">250.00</FIELD>
<FIELD NAME="OTHCHG">610.00</FIELD>
<FIELD NAME="TOTPRE">12,610.00</FIELD>
<FIELD NAME="CSIGNEDLOC">Atlanta, GA</FIELD>
<FIELD NAME="SIGNED DATE">07/30/2003</FIELD>
<FIELD NAME="SIGNED TIME">09:25:18</FIELD>
<FIELD NAME="OPINIT">DOCUCORP</FIELD>
<FIELD NAME="SIGNATURE">Authorized Representative</FIELD>
<FIELD NAME="GALMT">1,000,000</FIELD>
<FIELD NAME="PRCOLMT">1,000,000</FIELD>
<FIELD NAME="PAILMT">1,000,000</FIELD>
<FIELD NAME="PEROCC">1,000,000</FIELD>
<FIELD NAME="FDLMT">1,000,000</FIELD>
<FIELD NAME="MEDLMT">1,000,000</FIELD>
- <GROUP NAME="" NAME1="American Equity" NAME2="INTERLINE">
- <FORM NAME="FS100 10-2000">
<DESCRIPTION>Schedule of Forms/End</DESCRIPTION>
<FIELD NAME="FORM DESC LINE">Forms Applicable - INTERLINE</FIELD>
<FIELD NAME="FORM DESC LINE #003">A100J 02-1999 Policy Jacket -
AEIC</FIELD>
<FIELD NAME="FORM DESC LINE #004">A100 03-1997 Common Policy Dec -
AEIC</FIELD>
<FIELD NAME="FORM DESC LINE #005">A101 03-1997 Minimum Earned
Premium Endt</FIELD>
<FIELD NAME="FORM DESC LINE #006">A104 10-1998 Service of Suit</
FIELD>
<FIELD NAME="FORM DESC LINE #007">IL0017 11-1998 Common Policy
Conditions</FIELD>
<FIELD NAME="FORM DESC LINE #008">IL0021 04-1998 Nuclear Energy
Liab Excl Endt</FIELD>
<FIELD NAME="FORM DESC LINE #010">Forms Applicable - GENERAL
LIABILITY</FIELD>
<FIELD NAME="FORM DESC LINE #012">CL150 01-2000 General Liab
Coverage Part</FIELD>
<FIELD NAME="FORM DESC LINE #013">L003 03-1997 Amendment of Premium
Condition</FIELD>
<FIELD NAME="FORM DESC LINE #014">L005 01-2000 Contractual Liab
Limitation</FIELD>
<FIELD NAME="FORM DESC LINE #015">L007 07-1998 Ded Liab Ins-w/Costs
per Claim</FIELD>
<FIELD NAME="FORM DESC LINE #016">L150 01-2000 Additional
Exclusions</FIELD>
<FIELD NAME="FORM DESC LINE #017">CG0001 07-1998 Comm General Liab
Cov Form</FIELD>
<FIELD NAME="FORM DESC LINE #018">CG2160 09-1998 Excl - Year 2000
Computer Prob</FIELD>
<RECIPIENT NAME="EXTRA COPY" COPYCOUNT="1" />
<RECIPIENT NAME="GENERAL AGENT" COPYCOUNT="1" />
<RECIPIENT NAME="HOME OFFICE" COPYCOUNT="1" />
<RECIPIENT NAME="ORIGINAL" COPYCOUNT="1" />
<RECIPIENT NAME="RETAIL AGENT" COPYCOUNT="1" />
- <SHEET>
- <PAGE>
<SECTION NAME="FORMSCHA" />
</PAGE>
</SHEET>
</FORM
</DOCSET>
</DOCUMENT>
The output file looks like this:
A108;SAM MALONE;CHEERS, INC.;123 MAIN ST;SUITE 100;23033;12345;07/
05/2003;07/05/2004;; 12,000.00;
12,000.00;;1,000,000;1,000,000;1,000,000;1,000,000;1,000,000;1,000,000;
You can import this file into an Excel spreadsheet.