xsl-list
[Top] [All Lists]

Re: Repeated Recursion on different parts of a tree

2002-10-04 07:06:20

My XML and XSL for reference:
It's not enough to go on.
I padded it out to

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">


<xsl:template match="register">
<xsl:call-template name="calcInitialValue">
<xsl:with-param name="newNode" select="bitfield[1]"/>
</xsl:call-template>
</xsl:template>

 <xsl:template name="calcInitialValue">
  <xsl:param name="initialValue" /> 
  <xsl:param name="newNode" /> 
  <xsl:variable name="bitfieldInitialValue">
   <xsl:call-template name="shifter">
    <xsl:with-param name="Answer"
select="$newNode/initialvalue" /> 
    <xsl:with-param name="decimalBitPos" 
select="$newNode/bitpos" /> 
   </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="newValue" select="$bitfieldInitialValue + $initialValue" 
/> 
   <xsl:choose>
    <xsl:when test="following-sibling::bitfield">
     <xsl:call-template name="calcInitialValue">
      <xsl:with-param name="initialValue" 
select="$newValue" /> 
      <xsl:with-param name="newNode" 
select="following-sibling::bitfield[1]" /> 
     </xsl:call-template>
    </xsl:when>
   <xsl:otherwise>
    <xsl:value-of select="$newValue" /> 
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

</xsl:stylesheet>

and got

$ saxon try1.xml try1.xsl
Error at xsl:call-template on line 16 of file:/c:/tmp/try1.xsl:
  No template exists named shifter
Transformation failed: Failed to compile stylesheet. 1 error detected.


at which point I gave up.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list