XSLT transformation works in Editor but not debugger

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
gregpearman
Posts: 2
Joined: Fri Jun 06, 2003 8:01 pm

XSLT transformation works in Editor but not debugger

Post by gregpearman » Mon Jun 21, 2004 5:15 pm

I have an XSLT transformation (using Xalan) that works in the editor view. But, when I try stepping through the transformation via the debugger, I get a java.lang.StackOverflowError. I get the same error running the transformation from the command line.

Here is my xml file:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.acartus.com/indexes/1">
<documents key="1">
<ReportDate page="1"> 05/11/04 </ReportDate>
<ReportTime page="1"> 2:01:03 </ReportTime>
<ReportDescription page="1"> Plus Disb Acty after Disc </ReportDescription>
<ReportName page="1"> LSBATCH </ReportName>
<start_page>1</start_page>
<page_count>1</page_count>
</documents>
<documents key="3">
<ReportDate page="1"> 05/11/04 </ReportDate>
<ReportTime page="1"> 2:01:03 </ReportTime>
<ReportDescription page="1"> Plus Disb Acty after Disc </ReportDescription>
<ReportName page="1"> LSBATCH </ReportName>
<detail key="3">
<DataID page="1"> 003465296</DataID>
<Group_ID page="1">A </Group_ID>
<Balance page="1">00000000000</Balance>
<Claim_Status page="1"> </Claim_Status>
<Private_Loan page="1"> </Private_Loan>
<Conversion_Date page="1">04/08/04 </Conversion_Date>
<Due_Date page="1"> 06/07/04 </Due_Date>
<Disclosure_Date page="1">05/10/04 </Disclosure_Date>
<Status page="1">P30 </Status>
<Loan_Type page="1">PLUS</Loan_Type>
<LN_Number page="1">1 </LN_Number>
</detail>
<start_page>1</start_page>
<page_count>1</page_count>
</documents>
<documents key="4">
<ReportDate page="1"> 05/11/04 </ReportDate>
<ReportTime page="1"> 2:01:03 </ReportTime>
<ReportDescription page="1"> Plus Disb Acty after Disc </ReportDescription>
<ReportName page="1"> LSBATCH </ReportName>
<detail key="4">
<DataID page="1"> 003465296</DataID>
<Group_ID page="1">A </Group_ID>
<Balance page="1">00000000000</Balance>
<Claim_Status page="1"> </Claim_Status>
<Private_Loan page="1"> </Private_Loan>
<Conversion_Date page="1">04/08/04 </Conversion_Date>
<Due_Date page="1"> 06/07/04 </Due_Date>
<Disclosure_Date page="1">05/10/04 </Disclosure_Date>
<Status page="1">P30 </Status>
<Loan_Type page="1">PLUS</Loan_Type>
<LN_Number page="1">1 </LN_Number>
</detail>
<start_page>1</start_page>
<page_count>1</page_count>
</documents>
<documents key="5">
<ReportDate page="1"> 05/11/04 </ReportDate>
<ReportTime page="1"> 2:01:03 </ReportTime>
<ReportDescription page="1"> Plus Disb Acty after Disc </ReportDescription>
<ReportName page="1"> LSBATCH </ReportName>
<detail key="5">
<DataID page="1"> 006704007</DataID>
<Group_ID page="1">A </Group_ID>
<Balance page="1">00000000000</Balance>
<Claim_Status page="1"> </Claim_Status>
<Private_Loan page="1"> </Private_Loan>
<Conversion_Date page="1">04/23/04 </Conversion_Date>
<Due_Date page="1"> 06/22/04 </Due_Date>
<Disclosure_Date page="1">05/10/04 </Disclosure_Date>
<Status page="1">P30 </Status>
<Loan_Type page="1">PLUS</Loan_Type>
<LN_Number page="1">1 </LN_Number>
</detail>
<start_page>1</start_page>
<page_count>1</page_count>
</documents>
</root>
Here is my XSL document

Code: Select all


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:bf="http://www.acartus.com/indexes/1" exclude-result-prefixes="bf">
<!--********************************************************************
** Set the output result to be XML
********************************************************************-->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<!--********************************************************************
** There will come from BatchFlow
********************************************************************-->
<xsl:param name="LOCATION"/>
<xsl:param name="REPORT_CODE"/>
<!--********************************************************************
** These are used to determine if we have already processed
** a work item for this SSN
********************************************************************-->
<xsl:param name="currentSSN"/>
<xsl:param name="previousSSN"/>
<!--********************************************************************
** Start with the document root
********************************************************************-->
<xsl:template match="/">
<EP_Report>
<Manifest>
<SubType>
<xsl:value-of select="$REPORT_CODE"/>
</SubType>
<xsl:apply-templates select="bf:root/bf:documents[position() = 1]/bf:ReportDate"/>
<Location>
<xsl:value-of select="$LOCATION"/>
</Location>
<LineItemActual>
<xsl:value-of select="count(bf:root/bf:documents/bf:detail)"/>
</LineItemActual>
</Manifest>
<WorkItems>
<xsl:apply-templates select="bf:root/bf:documents">
<xsl:sort select="normalize-space(bf:detail/bf:DataID)"/>
</xsl:apply-templates>
</WorkItems>
</EP_Report>
</xsl:template>
<!--********************************************************************
** Get the first occurance of a ReportDate and use that as the
** Manifest ReportDate
********************************************************************-->
<xsl:template match="bf:ReportDate">
<ReportDate>
<xsl:call-template name="formatDate">
<xsl:with-param name="oldDate" select="normalize-space(.)"/>
</xsl:call-template>
</ReportDate>
</xsl:template>
<!--********************************************************************
** Get each document and only process the ones that have a
** detail child node.
********************************************************************-->
<xsl:template match="bf:documents">
<xsl:if test="bf:detail">
<xsl:apply-templates select="bf:detail" mode="buildWorkItem">
<xsl:with-param name="currentSSN" select="normalize-space(bf:detail/bf:DataID)"/>
<xsl:with-param name="previousSSN" select="normalize-space(preceding-sibling::bf:documents[position() = 1]/bf:detail/bf:DataID)"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<!--********************************************************************
** Get the details of the document. Each detail represents a
** single work item.
********************************************************************-->
<xsl:template match="bf:detail" mode="buildWorkItem">
<xsl:param name="currentSSN"/>
<xsl:param name="previousSSN"/>
<xsl:if test="$currentSSN != $previousSSN">
<WorkItem>
<DataId>
<xsl:value-of select="normalize-space(bf:DataID)"/>
</DataId>
<xsl:if test="bf:Group_ID">
<AlternateId>
<xsl:value-of select="normalize-space(bf:Group_ID)"/>
</AlternateId>
</xsl:if>
<xsl:if test="bf:Last_Name">
<LastName>
<xsl:value-of select="normalize-space(bf:Last_Name)"/>
</LastName>
</xsl:if>
<xsl:if test="bf:First_Name">
<FirstName>
<xsl:value-of select="normalize-space(bf:First_Name)"/>
</FirstName>
</xsl:if>
<Balance>
<xsl:choose>
<xsl:when test="bf:Balance">
<xsl:call-template name="formatBalance">
<xsl:with-param name="oldBalance" select="normalize-space(bf:Balance)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</Balance>
<ClaimStatus>
<xsl:choose>
<xsl:when test="bf:Claim_Status">
<xsl:choose>
<xsl:when test="string-length(normalize-space(bf:Claim_Status)) > 0">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</ClaimStatus>
<PrivateLoan>
<xsl:choose>
<xsl:when test="bf:Private_Loan">
<xsl:choose>
<xsl:when test="string-length(normalize-space(bf:Private_Loan)) > 0">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</PrivateLoan>
<ReportData>
<xsl:value-of disable-output-escaping="yes" select="concat('<','![CDATA[')"/>
<xsl:apply-templates
select="/bf:root/bf:documents/bf:detail[normalize-space(bf:DataID) = $currentSSN]" mode="buildLineItem"/>
<xsl:value-of disable-output-escaping="yes" select="concat(']]', '>')"/>
</ReportData>
</WorkItem>
</xsl:if>
</xsl:template>
<!--********************************************************************
** This template creates a LineItem.
********************************************************************-->
<xsl:template match="bf:detail" mode="buildLineItem">
<LineItem>
<Conversion_Date>
<xsl:call-template name="formatDate">
<xsl:with-param name="oldDate" select="normalize-space(bf:Conversion_Date)"/>
</xsl:call-template>
</Conversion_Date>
<Due_Date>
<xsl:call-template name="formatDate">
<xsl:with-param name="oldDate" select="normalize-space(bf:Due_Date)"/>
</xsl:call-template>
</Due_Date>
<Disclosure_Date>
<xsl:call-template name="formatDate">
<xsl:with-param name="oldDate" select="normalize-space(bf:Disclosure_Date)"/>
</xsl:call-template>
</Disclosure_Date>
<Status>
<xsl:value-of select="normalize-space(bf:Status)"/>
</Status>
<Loan_Type>
<xsl:value-of select="normalize-space(bf:Loan_Type)"/>
</Loan_Type>
<LN_Number>
<xsl:value-of select="normalize-space(bf:LN_Number)"/>
</LN_Number>
</LineItem>
</xsl:template>
<!--********************************************************************
** This template takes a string in the format of MMxDDxYY and
** converts it to an XML acceptable date value of CCYY-MM-DD.
** The "x" can be any character since it is effectively ignored.
********************************************************************-->
<xsl:template name="formatDate">
<xsl:param name="oldDate"/>
<xsl:text>20</xsl:text>
<xsl:value-of select="substring($oldDate, 7, 2)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring($oldDate, 1, 2)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring($oldDate, 4, 2)"/>
</xsl:template>
<!--********************************************************************
** This template takes a Balance and makes it an integer.
********************************************************************-->
<xsl:template name="formatBalance">
<xsl:param name="oldBalance"/>
<xsl:value-of select="number($oldBalance)"/>
</xsl:template>
</xsl:stylesheet>
The offending line is:

Code: Select all


<xsl:with-param name="previousSSN" select="normalize-space(preceding-sibling::bf:documents[position() = 1]/bf:detail/bf:DataID)"/>