heres the xsl file im using.....below
this creates a summary report based on xml inputfile
msxml utility works fine, net 20 c# xsltransform crashes with stackoverflow
exception
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl

utput method="text"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="CLAIMS">
<xsl:variable name="headerDescription">Dear: <xsl:value-of
select="CLAIM[1]/
@user"/>
=======================================================================================================================================================================================================
Your File has been processed by Office Ally. The status of the claims
contained in the file are as
detailed below. If there are any failures please correct the problem and
resubmit the claim. To
assist you in correcting your claims they will be available in the ClaimFix
section within 24 hours.
=======================================================================================================================================================================================================
Summary report for: <xsl:value-of select="CLAIM[1]/OAFILENAME"/>
Uploaded on : <xsl:value-of select="CLAIM[1]/@DATERECEIVED"/>
Processed on: <xsl:value-of select="CLAIM[1]/@DATEPROCESSED"/>
The fileid assigned to this upload is: <xsl:value-of
select="CLAIM[1]/@PARENTFILEID"/>, all accepted claims from this upload were
delivered to the following payers.</xsl:variable>
<xsl:variable name="totalBilled">
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items" select="CLAIM"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="totalPassed">
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items" select="CLAIM[@STATUSID=110]"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="totalPend">
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items" select="CLAIM[@STATUSID=104]"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="totalDupe">
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items" select="CLAIM[@STATUSID=105]"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="totalFailed">
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items"
select="CLAIM[@STATUSID!=110][@STATUSID!=104][@STATUSID!=105]"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="distinctMembers">
<xsl:call-template name="gatherMembers">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="claim" select="CLAIM"/>
<xsl:with-param name="runningList" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="allErrors">
<xsl:call-template name="describeErrors">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="claim" select="CLAIM/ERROR"/>
<xsl:with-param name="runningList" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$headerDescription"/>
=======================================================================================================================================================================================================
<xsl:value-of select="$distinctMembers"/>:
=======================================================================================================================================================================================================
Total Amount Billed :<xsl:call-template
name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($totalBilled,'$###,###,##0.00')"/>
</xsl:call-template>
Total Amount Passed (ACK) :<xsl:call-template
name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($totalPassed,'$###,###,##0.00')"/>
</xsl:call-template>
Total Amount Pended (PND) :<xsl:call-template
name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($totalPend,'$###,###,##0.00')"/>
</xsl:call-template>
Total Amount Failed (REJ) :<xsl:call-template
name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($totalFailed,'$###,###,##0.00')"/>
</xsl:call-template>
Total Amount Duplicate (DUP) :<xsl:call-template
name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($totalDupe,'$###,###,##0.00')"/>
</xsl:call-template>
<xsl:if test="count(CLAIM/ERROR) > 0">
=======================================================================================================================================================================================================
Error Code Legend:
--------- -------- ------------------
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="9"/>
<xsl:with-param name="value" select="'Count'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="'Code'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="167"/>
<xsl:with-param name="value" select="'Error Description'"/>
</xsl:call-template>
--------- -------- ------------------
<xsl:value-of select="$allErrors"/>
</xsl:if>
=======================================================================================================================================================================================================
<!--Display the headers -->
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="6"/>
<xsl:with-param name="value" select="' '"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="'STATUS'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="'CLAIM ID'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="20"/>
<xsl:with-param name="value" select="'PATIENT ACCT'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="20"/>
<xsl:with-param name="value" select="'PATIENT (L, F)'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="'DOB'"/>
</xsl:call-template>
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="15"/>
<xsl:with-param name="value" select="'TOTAL CHARGE'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="'DOS'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="'PROCEDURE'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="'BILL TAXID'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="14"/>
<xsl:with-param name="value" select="'BILLING ID #2'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="'PAYER'"/>
</xsl:call-template>
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="43"/>
<xsl:with-param name="value" select="'ERROR CODES'"/>
</xsl:call-template> :
=======================================================================================================================================================================================================
<!-- FOR EACH OF THE CLAIMS IN THE FILE, DISPLAY THEIR INFORMATION -->
<xsl:for-each select="CLAIM">
<xsl:variable name="claimnumber">
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="7"/>
<xsl:with-param name="value" select="concat(position(),') ')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedStatus">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="7"/>
<xsl:with-param name="value" select="CLAIMSTATUS"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedClaimID">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="@CLAIMID"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedPCN">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="20"/>
<xsl:with-param name="value" select="PATIENTACCOUNTNO"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedPATIENT">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="20"/>
<xsl:with-param name="value" select="concat(concat(PATLASTNAME,',
'),PATFIRSTNAME)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedDOB">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="PATIENTDOB"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedCHARGE">
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="15"/>
<xsl:with-param name="value"
select="format-number(TOTALCHARGE,'$###,##0.00')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedDOS">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="DATEOFSERVICE"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedCPT">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="PROCEDURECODE"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedBillTaxID">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="BILLINGTAXID"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedBillID">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="12"/>
<xsl:with-param name="value" select="BILLINGID"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedAcronym">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="ACRONYM"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="errorList">
<xsl:call-template name="gatherErrors">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="error" select="ERROR"/>
<xsl:with-param name="runningList" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedErrorList">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="43"/>
<xsl:with-param name="value" select="$errorList"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$claimnumber"/>
<xsl:value-of select="$formattedStatus"/>
<xsl:value-of select="$formattedClaimID"/>
<xsl:value-of select="$formattedPCN"/>
<xsl:value-of select="$formattedPATIENT"/>
<xsl:value-of select="$formattedDOB"/>
<xsl:value-of select="$formattedCHARGE"/>
<xsl:value-of select="$formattedDOS"/>
<xsl:value-of select="$formattedCPT"/>
<xsl:value-of select="$formattedBillTaxID"/>
<xsl:value-of select="$formattedBillID"/>
<xsl:value-of select="$formattedAcronym"/>
<xsl:value-of select="$formattedErrorList"/> :
<xsl:if test="contains($formattedStatus,'DUP')">
<xsl:variable name="formattedDupeFileID">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="DUPEFILEID"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedDupeClaimID">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="15"/>
<xsl:with-param name="value" select="DUPEOF"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedDupeDate">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="15"/>
<xsl:with-param name="value" select="DUPEDATERECEIVED"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="formattedDupeControlNum">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="50"/>
<xsl:with-param name="value" select="DUPECONTROLNUMBER"/>
</xsl:call-template>
</xsl:variable>The above claim is a duplicate of: <xsl:value-of
select="$formattedDupeClaimID"/> From file: <xsl:value-of
select="$formattedDupeFileID"/> Processed on: <xsl:value-of
select="$formattedDupeDate"/>:
</xsl:if>
</xsl:for-each>
=======================================================================================================================================================================================================</xsl:template>
<xsl:template name="gatherMembers">
<xsl

aram name="index" select="'1'"/>
<xsl

aram name="claim"/>
<xsl

aram name="runningList" select="''"/>
<xsl:variable name="seper">
<xsl:text>:
</xsl:text>
</xsl:variable>
<xsl:if test="count($claim) > 0">
<xsl:variable name="currentItem">
<xsl:value-of select="$claim[$index]/MEMBERNAME"/>
</xsl:variable>
<xsl:variable name="currentMemID">
<xsl:value-of select="$claim[$index]/@SPLITTER"/>
</xsl:variable>
<xsl:variable name="remainingItems">
<xsl:choose>
<xsl:when test="$index > count($claim)">
<xsl:text/>
</xsl:when>
<xsl

therwise>
<xsl:call-template name="gatherMembers">
<xsl:with-param name="index" select="$index+1"/>
<xsl:with-param name="claim" select="$claim"/>
<xsl:with-param name="runningList"
select="concat(concat($runningList,','),$currentItem)"/>
</xsl:call-template>
</xsl

therwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($remainingItems) > 0">
<xsl:choose>
<xsl:when test="contains($remainingItems,$currentItem)">
<xsl:value-of select="$remainingItems"/>
</xsl:when>
<xsl

therwise>
<xsl:variable name="thisMember">
<xsl:call-template name="memStats">
<xsl:with-param name="memid" select="$currentMemID"/>
<xsl:with-param name="file" select="$claim"/>
<xsl:with-param name="claim" select="$claim[$index]"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat(concat($thisMember,$seper),
$remainingItems)"/>
</xsl

therwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length($currentItem) > 0">
<xsl:call-template name="memStats">
<xsl:with-param name="memid" select="$currentMemID"/>
<xsl:with-param name="file" select="$claim"/>
<xsl:with-param name="claim" select="$claim[$index]"/>
</xsl:call-template>
<!--<xsl:value-of select="$currentItem"/>-->
</xsl:when>
<xsl

therwise>
<xsl:text/>
</xsl

therwise>
</xsl:choose>
</xsl:if>
<xsl:if test="count($claim) = 0">
<xsl:text/>
</xsl:if>
</xsl:template>
<xsl:template name="memStats">
<xsl

aram name="memid"/>
<xsl

aram name="file"/>
<xsl

aram name="claim"/>
<xsl:variable name="memAcronym">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="concat(concat('(
',$claim/ACRONYM),' ) ')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="memCount">
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="count($file[@SPLITTER=$memid])"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="memName">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="50"/>
<xsl:with-param name="value" select="$claim/MEMBERNAME"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="memChargesTmp">0
<!--<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="'1'"/>
<xsl:with-param name="items" select="$file[@SPLITTER=$memid]"/>
<xsl:with-param name="runningTotal" select="'0'"/>
</xsl:call-template>-->
</xsl:variable>
<xsl:variable name="memCharges">
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="18"/>
<xsl:with-param name="value"
select="format-number($memChargesTmp,'$###,###,##0.00')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="thisFileid">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="10"/>
<xsl:with-param name="value" select="$claim/@FILEID"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select="concat($thisFileid,concat(concat(concat($memAcronym,$memName),$memCount),$memCharges))"/>
</xsl:template>
<xsl:template name="gatherErrors">
<xsl

aram name="index" select="'1'"/>
<xsl

aram name="error"/>
<xsl

aram name="runningList" select="''"/>
<xsl:if test="count($error) > 0">
<xsl:variable name="currentItem">
<xsl:value-of select="$error[$index]/CODE"/>
</xsl:variable>
<xsl:variable name="remainingItems">
<xsl:choose>
<xsl:when test="$index=count($error)">
<xsl:text/>
</xsl:when>
<xsl

therwise>
<xsl:call-template name="gatherErrors">
<xsl:with-param name="index" select="$index+1"/>
<xsl:with-param name="error" select="$error"/>
<xsl:with-param name="runningList"
select="concat(concat($runningList,', '), $currentItem)"/>
</xsl:call-template>
</xsl

therwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($remainingItems) > 0">
<xsl:value-of select="concat(concat($currentItem,',
'),$remainingItems)"/>
</xsl:when>
<xsl:when test="string-length($currentItem) > 0">
<xsl:value-of select="$currentItem"/>
</xsl:when>
<xsl

therwise>
<xsl:text/>
</xsl

therwise>
</xsl:choose>
</xsl:if>
<xsl:if test="count($error) = 0">
<xsl:text/>
</xsl:if>
</xsl:template>
<xsl:template name="describeErrors">
<xsl

aram name="index" select="'1'"/>
<xsl

aram name="claim"/>
<xsl

aram name="runningList" select="''"/>
<xsl:variable name="seper">
<xsl:text>:
</xsl:text>
</xsl:variable>
<xsl:if test="count($claim) > 0">
<xsl:variable name="currentItem">
<xsl:value-of select="$claim[$index]/CODE"/>
</xsl:variable>
<xsl:variable name="currentErrorID">
<xsl:value-of select="$claim[$index]/@ID"/>
</xsl:variable>
<xsl:variable name="remainingItems">
<xsl:choose>
<xsl:when test="$index=count($claim)">
<xsl:text/>
</xsl:when>
<xsl

therwise>
<xsl:call-template name="describeErrors">
<xsl:with-param name="index" select="$index+1"/>
<xsl:with-param name="claim" select="$claim"/>
<xsl:with-param name="runningList"
select="concat(concat($runningList,', '), $currentItem)"/>
</xsl:call-template>
</xsl

therwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($remainingItems) > 0">
<xsl:choose>
<xsl:when test="contains($remainingItems,$currentItem)">
<xsl:value-of select="$remainingItems"/>
</xsl:when>
<xsl

therwise>
<xsl:variable name="thisError">
<xsl:call-template name="errorStats">
<xsl:with-param name="errorID" select="$currentErrorID"/>
<xsl:with-param name="errors" select="$claim"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat(concat($thisError,$seper),
$remainingItems)"/>
</xsl

therwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length($currentItem) > 0">
<xsl:call-template name="errorStats">
<xsl:with-param name="errorID" select="$currentErrorID"/>
<xsl:with-param name="errors" select="$claim"/>
</xsl:call-template>
</xsl:when>
<xsl

therwise>
<xsl:text>interesting...</xsl:text>
</xsl

therwise>
</xsl:choose>
</xsl:if>
<xsl:if test="count($claim) = 0">
<xsl:text>no errors</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="errorStats">
<xsl

aram name="errorID"/>
<xsl

aram name="errors"/>
<xsl:variable name="errorCount">
<xsl:call-template name="positionElementsRight">
<xsl:with-param name="fieldlength" select="9"/>
<xsl:with-param name="value"
select="format-number(count($errors[@ID=$errorID]),'###,###,##0')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="errorCode">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="8"/>
<xsl:with-param name="value" select="$errors[@ID=$errorID]/CODE"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="errorDescription">
<xsl:call-template name="positionElements">
<xsl:with-param name="fieldlength" select="168"/>
<xsl:with-param name="value"
select="$errors[@ID=$errorID]/DESCRIPTION"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select="concat(concat($errorCount,$errorCode),$errorDescription)"/>
</xsl:template>
<xsl:template name="sumCharges">
<xsl

aram name="index" select="'1'"/>
<xsl

aram name="items"/>
<xsl

aram name="runningTotal" select="'0'"/>
<xsl:variable name="currentItem">
<xsl:value-of select="$items[$index]/TOTALCHARGE"/>
</xsl:variable>
<xsl:if test="count($items) > 0">
<xsl:variable name="remainingItems">
<xsl:choose>
<xsl:when test="$index=count($items)">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl

therwise>
<xsl:call-template name="sumCharges">
<xsl:with-param name="index" select="$index+1"/>
<xsl:with-param name="items" select="$items"/>
<xsl:with-param name="runningTotal"
select="$runningTotal+$currentItem"/>
</xsl:call-template>
</xsl

therwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$currentItem+$remainingItems"/>
</xsl:if>
<xsl:if test="count($items) = 0">
<xsl:text>0</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="positionElements">
<xsl

aram name="fieldlength"/>
<xsl

aram name="value"/>
<xsl:variable name="filler" select="'
'"/>
<xsl:choose>
<xsl:when test="string-length($value) < $fieldlength">
<xsl:value-of select="concat($value,substring($filler, 1,($fieldlength -
string-length($value))))"/>
</xsl:when>
<xsl

therwise>
<xsl:value-of select="concat(substring($value, 1,$fieldlength - 1),'
')"/>
</xsl

therwise>
</xsl:choose>
</xsl:template>
<xsl:template name="positionElementsRight">
<xsl

aram name="fieldlength"/>
<xsl

aram name="value"/>
<xsl:variable name="filler" select="'
'"/>
<xsl:choose>
<xsl:when test="string-length($value) < $fieldlength">
<xsl:value-of select="concat(concat(substring($filler, 1,($fieldlength -
string-length($value))),$value),' ')"/>
</xsl:when>
<xsl

therwise>
<xsl:value-of select="concat(substring($value, 1,$fieldlength - 1),'
')"/>
</xsl

therwise>
</xsl:choose>
</xsl:template>
<xsl:template name="incrementCount">
<xsl

aram name="value"/>
<xsl:choose>
<xsl:when test="$value=0">1</xsl:when>
<xsl

therwise>
<xsl:value-of select="$value+1"/>
</xsl

therwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>