Situation:
I have a set of XSLT scripts that function correctly under
interpreted xalan. I am trying to test the performance benefit of shifting
to the TRAX compiler. We are running three successive transformations
(one to produce outbound data, two to take inbound data and convert it to a
form usable by another process). The first of the three scripts is
failing. It is also the first loaded.
Environment:
Sun client JDK 1.4.1
Xalan 2.6.0 (as shipped)
Windows XP
Requested Action:
(a) confirm that this is or is not a bug in TRAX
(b) suggest workarounds
Symptom:
After cleaning up my scripts so that they compile correctly, and
confirming that they still function in interpreted mode, I am receiving
this exception when I try to execute the script:
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.<init>(Lorg/apache/xml/dtm/DTMManager;Ljavax/xml/transform/Source;ILorg/apache/xml/dtm/DTMWSFilter;Lorg/apache/xml/utils/XMLStringFactory;ZIZZ)V
java.lang.NoSuchMethodError:
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.<init>(Lorg/apache/xml/dtm/DTMManager;Ljavax/xml/transform/Source;ILorg/apache/xml/dtm/DTMWSFilter;Lorg/apache/xml/utils/XMLStringFactory;ZIZZ)V
at org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2.<init>(SAX2DTM2.java:1866)
at org.apache.xalan.xsltc.dom.SAXImpl.<init>(SAXImpl.java:725)
at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:351)
at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:228)
at
org.apache.xalan.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:437)
at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:597)
at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)
at
com.xxxxx.apps.MapTuIt.GeocodeTransformerChain.transform(GeocodeTransformerChain.java:1312)
at
com.xxxxx.apps.MapTuIt.GeocodeTransformerChain.main(GeocodeTransformerChain.java:1961)
-------------------------------------------------------------
Source data:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<records>
<record>
<field name="GEOREQ-MESSAGE-TYPE">GEOREQ</field>
<field name="GEOREQ-DATE-TIME">2004-07-29 12:28:15</field>
<field name="GEOREQ-CLIENT-ID">xxxxx</field>
<field name="GEOREQ-FLEET-ID"> </field>
<field name="GEOREQ-TRUCK-ID"> </field>
<field name="GEOREQ-DRIVER-ID"> </field>
<field name="GEOREQ-LOAD-NUM"> </field>
<field name="GEOREQ-REQUEST-ID"> </field>
<field name="GEOREQ-ACTION">UPDATE</field>
<field name="GEOREQ-OWNER-ID">SRMO42</field>
<field name="GEOREQ-NAME">STONEY RIDGE TRUCK PLA</field>
<field name="GEOREQ-STREET">125 HAMPTON LEBON RD</field>
<field name="GEOREQ-STREET2">I75 EXIT 29 ROUTE 63 (TST)</field>
<field name="GEOREQ-CITY">MONROE</field>
<field name="GEOREQ-STATE">OH</field>
<field name="GEOREQ-ZIP">45050 -</field>
<field name="GEOREQ-COUNTRY">USA</field>
<field name="GEOREQ-DEPT-ID">FUELSTN</field>
</record>
</records>
-------------------------------------------------------------
Transformation script:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- Doctype is handled by java wrapper transaction -->
<xsl:output
method="xml" version="1.0" encoding="UTF-8" indent="yes"
doctype-public="__publicdoctype__"
doctype-system="__systemdoctype__"
omit-xml-declaration="no" />
<!-- xsl to convert JB Hunt "records/record/fields/field" XML layout to
Maptuit
AttractionsML XML layout.
Created: 20 March 2004
Author: David Johnson JISADJ3
Copyright (c) 2004 JB Hunt Transport Inc. http://www.xxxxx.com
Critical information:
This is a configuration file. Different versions exist for TEST
and
PROD.
The difference exists in the <xsl:template name="Client">
element.
ClientId for test is "xxxxxdev", and the ClientId for production
is
"xxxxx".
Basis of operation:
Data is received from MQ in a COBOL copybook format and converted
to a
"records/record/fields/field" xml format prior to this
transformation.
The Attractions_ML DTD defines the calls as singletons, but this
transform will also support batching by encapsulation in a batch
parser within the master configuration file.
See also:
AttractionML_1.1.dtd from Maptuit corporation.
-->
<!-- todo: refactor and isolate ClientId into maptuit-environment.xml -->
<xsl:template name="Client">
<xsl:attribute name="ClientId">xxxxxdev</xsl:attribute>
</xsl:template>
<xsl:template match="/records">
<Maptuit>
<xsl:apply-templates select="record"/>
</Maptuit>
</xsl:template>
<xsl:template match="record">
<xsl:choose>
<!-- Fuel Request has separate DTD so it is in its own XSL transform -->
<xsl:when test="[EMAIL PROTECTED]'FUELREQ-FUNCTION'] = 'AddStations'">
<xsl:call-template name="FuelLocation">
<xsl:with-param name="operation" select="'AddStations'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'FUELREQ-FUNCTION'] = 'UpdateStations'">
<xsl:call-template name="FuelLocation">
<xsl:with-param name="operation" select="'UpdateStations'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'FUELREQ-FUNCTION'] = 'DeleteStations'">
<xsl:call-template name="FuelLocation">
<xsl:with-param name="operation" select="'DeleteStations'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-ACTION'] = 'INSERT'">
<xsl:call-template name="AddAddressReq"/>
</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-ACTION'] = 'UPDATE'">
<xsl:call-template name="UpdateAddressReq"/>
</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-ACTION'] = 'DELETE'">
<xsl:call-template name="DelAddressReq"/>
</xsl:when>
<!-- <xsl:when test="[EMAIL PROTECTED]'DIRREQ-ACTION'] = 'DIRREQ'">-->
<xsl:when test="[EMAIL PROTECTED]'DIRREQ-MESSAGE-TYPE'] = 'DIRREQ'">
<xsl:call-template name="TruckrouteReq"/>
</xsl:when>
<xsl:otherwise>
<ERROR>FUELREQ-FUNCTION="<xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-FUNCTION']"/>"</ERROR>
<ERROR>GEOREQ-FUNCTION="<xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-ACTION']"/>"</ERROR>
<ERROR>DIRREQ-FUNCTION="<xsl:value-of
select="[EMAIL PROTECTED]'DIRREQ-ACTION']"/>"</ERROR>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="TruckrouteReq">
<TruckrouteReq>
<!--<xsl:attribute name="PlanType"></xsl:attribute>-->
<xsl:attribute name="FleetId">
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-FLEET-ID']"/>
</xsl:attribute>
<xsl:attribute name="TruckId">
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-TRUCK-ID']"/>
</xsl:attribute>
<xsl:attribute name="DriverId">
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-DRIVER-ID']"/>
</xsl:attribute>
<xsl:attribute name="LoadNum">
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-LOAD-NUM']"/>
</xsl:attribute>
<xsl:attribute name="TransactionNum">
<!--<xsl:attribute name="RequestId">-->
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-REQUEST-ID']"/>
</xsl:attribute>
<xsl:attribute name="Units">
<xsl:value-of select="'mi'"/>
</xsl:attribute>
<xsl:call-template name="Client"/>
<RequestorType>
<xsl:value-of
select="[EMAIL PROTECTED]'DIRREQ-STOPS']/group[1]/[EMAIL
PROTECTED]'DIRREQ-REQUESTOR-TYPE']"/>
</RequestorType>
<Date>
<xsl:value-of
select="[EMAIL PROTECTED]'DIRREQ-STOPS']/group[1]/[EMAIL
PROTECTED]'DIRREQ-DATE-1']"/>
</Date>
<!-- Truck Stops -->
<xsl:apply-templates select="group-list/group"/>
<!--
<Expired>
<xsl:value-of
select="[EMAIL PROTECTED]'DIRREQ-STOPS']/group[1]/[EMAIL
PROTECTED]'DIRREQ-EXPIRED-1']"/>
</Expired>
-->
</TruckrouteReq>
</xsl:template>
<xsl:template match="group-list/group">
<xsl:if test="@name='DIRREQ-STOPS'">
<xsl:if test="string-length([EMAIL PROTECTED]'DIRREQ-TRUCK-STOP-TYPE']) >
0">
<TruckStop>
<xsl:if test="string-length([EMAIL PROTECTED]'DIRREQ-ACTION']) > 0">
<Action>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-ACTION']"/>
</Action>
</xsl:if>
<TruckStopType>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-TRUCK-STOP-TYPE']"/>
</TruckStopType>
<xsl:choose>
<xsl:when test="string-length([EMAIL PROTECTED]'DIRREQ-OWNER-ID']) >
0">
<OwnerID>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-OWNER-ID']"/>
</OwnerID>
</xsl:when>
<xsl:otherwise>
<Longitude>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-LONGITUDE']"/>
</Longitude>
<Latitude>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-LATITUDE']"/>
</Latitude>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="string-length([EMAIL PROTECTED]'DIRREQ-CUSTOM-NOTE']) >
0">
<CustomNote>
<xsl:value-of select="[EMAIL PROTECTED]'DIRREQ-CUSTOM-NOTE']"/>
</CustomNote>
</xsl:if>
</TruckStop>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="AddAddressReq">
<AddAddressReq>
<xsl:call-template name="Client"/>
<AddLocationReq>
<xsl:call-template name="Location"/>
</AddLocationReq>
</AddAddressReq>
</xsl:template>
<xsl:template name="UpdateAddressReq">
<UpdateAddressReq>
<xsl:call-template name="Client"/>
<UpdateLocationReq>
<xsl:call-template name="Location"/>
</UpdateLocationReq>
</UpdateAddressReq>
</xsl:template>
<xsl:template name="DelAddressReq">
<DelAddressReq>
<xsl:call-template name="Client"/>
<xsl:call-template name="Location"/>
</DelAddressReq>
</xsl:template>
<xsl:template name="Location">
<!-- Kludge to allow MapTuit to identify fuel stations os that they
can be added to the Fueling process after geocoding. MapTuit
has a trigger on the geocode table that recognizes this and
migrates the geocoding to their fuel optimizing system.
-->
<xsl:choose>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-DEPT-ID']='FUELSTN'">
<!-- <OwnerID>fuel_<xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-IDMS-ID']"/></OwnerID> -->
<OwnerID>fuel_<xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-OWNER-ID']"/></OwnerID>
</xsl:when>
<xsl:otherwise>
<OwnerID><xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-OWNER-ID']"/></OwnerID>
</xsl:otherwise>
</xsl:choose>
<Name><xsl:value-of select="[EMAIL PROTECTED]'GEOREQ-NAME']"/></Name>
<Address>
<Street><xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-STREET']"/></Street>
<xsl:if test="[EMAIL PROTECTED]'GEOREQ-STREET2']!=''">
<Street2><xsl:value-of
select="[EMAIL PROTECTED]'GEOREQ-STREET2']"/></Street2>
</xsl:if>
<City><xsl:value-of select="[EMAIL PROTECTED]'GEOREQ-CITY']"/></City>
<State><xsl:value-of select="[EMAIL PROTECTED]'GEOREQ-STATE']"/></State>
<Zip><xsl:value-of select="[EMAIL PROTECTED]'GEOREQ-ZIP']"/></Zip>
<Country>
<xsl:choose>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-COUNTRY'] =
'USA'">US</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-COUNTRY'] =
'MEX'">MX</xsl:when>
<xsl:when test="[EMAIL PROTECTED]'GEOREQ-COUNTRY'] =
'CAN'">CA</xsl:when>
</xsl:choose>
</Country>
</Address>
</xsl:template>
<xsl:template name="FuelLocation">
<xsl:param name="operation"/>
<FuelManagementReq>
<xsl:attribute name="Cmd"><xsl:value-of
select="$operation"/></xsl:attribute>
<xsl:call-template name="Client"/>
<Station>
<xsl:attribute name="Id"><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-STA-ID']"/></xsl:attribute>
<xsl:if test="boolean (number ([EMAIL PROTECTED]'FUELREQ-ABS-PRICE']))">
<AbsPrice><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-ABS-PRICE']"/></AbsPrice>
</xsl:if>
<xsl:if test="boolean (number ([EMAIL PROTECTED]'FUELREQ-FEED-ID']))">
<CostPlus><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-COST-PLUS']"/></CostPlus>
</xsl:if>
<FeedID><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-FEED-ID']"/></FeedID>
<xsl:if test="[EMAIL PROTECTED]'FUELREQ-NOTES'] != ''">
<Note><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-NOTES']"/></Note>
</xsl:if>
<xsl:if test="boolean (number ([EMAIL PROTECTED]'FUELREQ-RET-MINUS']))">
<RetailMinus><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-RET-MINUS']"/></RetailMinus>
</xsl:if>
<StationID><xsl:value-of
select="[EMAIL PROTECTED]'FUELREQ-STA-OWNER-ID']"/></StationID>
</Station>
</FuelManagementReq>
</xsl:template>
</xsl:stylesheet>
David Johnson
Programmer Analyst
J. B. Hunt Transport
Information Services / OPR New Dev