I am new to XSLT and I am trying to work through a simple transformation process (XML to XML). I am trying to locate a bug in my XSLT code. The error I am getting is:
javax.xml.transform.TranformerConfigurationException:
javax.xml.transform.TransformerException: java.lang.RuntimeException:
Programmer's assertion in getNextStepPos; unknown stepType:-1 (Location of error unknown.)
I don't find to much documentation on this type of error other than ensuring I don't use a "==" in any evaluation.
What I have done in an effort to locate this bug is to comment (<!-- and -->
out all but two templates in the source file. The "Main" and "tech_order_object". However, I am still getting the error.
Here is the XSLT (mimus the commented out portions):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xalan="http://xml.apache.org/xslt">
<xsl
utput method="xml"
encoding="UTF-8"
indent="yes"
xalan:indent-amount="2"/>
<xsl:template name="Main" match="/">
<operation action="{TC_MODEL/@event}">
<xsl:call-template name="tech_order_object">
<xsl:with-param name="techOrder" select="//Object[@class='TechOrder']"/>
</xsl:call-template>
</operation>
</xsl:template>
<xsl:template name="tech_order_object">
<xsl
aram name="techOrder"/>
<TechOrder>
<objID><xsl:value-of select="$techOrder/@OBID="/></objID>
<number><xsl:value-of select="$techOrder/Attribute[@name='Number']"/></number>
<type><xsl:value-of select="$techOrder/Attribute[@name='Type']"/></type>
<title><xsl:value-of select="$techOrder/Attribute[@name='Title']"/></title>
<classification><xsl:value-of select="$techOrder/Attribute[@name='Classification']"/></classification>
<revision><xsl:value-of select="$techOrder/Attribute[@name='RevisionNumber']"/></revision>
<updated><xsl:value-of select="$techOrder/Attribute[@name='Updated']"/></updated>
</TechOrder>
</xsl:template>
</xsl:stylesheet>
This is the data:
<?xml version="1.0" encoding="UTF-8"?>
<TC_MODEL event="UPDATE">
<Object class="TechOrder" creationDate="2003/09/26-13:11:52:476" OBID="njAnk2isite-etestdb-ettable-objid"><!--TO Number-->
<Attribute name="Number" type="String" length="30">
<
String>TO-00-21-15-23</String>
</Attribute>
<Attribute name="Type" type="String" length="30">
<String>Weapons</String>
</Attribute><!--TO Title-->
<Attribute name="Title" type="String" length="30">
<String>The Fine Art Of Zen</String>
</Attribute><!--Classification-->
<Attribute name="Classification" type="String" length="30">
<String>UNCLASSIFIED</String>
</Attribute><!--TO Classification-->
<Attribute name="RevisionNumber" type="String" length="30">
<String>1.0.2.234.12</String>
</Attribute><!--Last updated-->
<Attribute name="Updated" type="TimeStamp">
<TimeStamp>2003/09/26-11:11:54:325</TimeStamp>
</Attribute><!--Date TO Created-->
<Attribute name="CreationDate" type="TimeStamp">
<TimeStamp>1973/01/31-11:11:54.125</TimeStamp>
</Attribute><!--Office of Primary Responsibility(Ownership)-->
<Attribute name="Creator" type="String" length="30">
<String>AMC/DOA</String>
</Attribute><!--Collection of Object References for Tech Order Content-->
<Attribute name="TechOrder_Content_Refs" type="NVSet">
<NameValue>
<Name>TechOrder_ContentRef</Name>
<Value>asd-fgh-234-Fed-01</Value>
</NameValue>
<NameValue>
<Name>TechOrder_ContentRef</Name>
<Value>dfg-hjk-678-org-02</Value>
</NameValue>
</Attribute><!--Collection of Object References for Subscription-->
<Attribute name="TechOrder_Subscribe_ObjRefs" type="NVSet">
<NameValue>
<Name>TechOrder_Subscripe_ObjRef</Name>
<Value>pokie-dokie-dsf-ojn-01</Value>
</NameValue>
</Attribute>
</Object>
Could someone point me in the right direction?
Thanks for taking the time to read this!