[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Repeated Recursion on different parts of a tree

Subject: Re: Repeated Recursion on different parts of a tree
From: Peter Doggett <ee99ppd@xxxxxxxxxxxx>
Date: Fri, 4 Oct 2002 15:33:21 +0100 (BST)
w doggett template
Ok cheers David.

I actually Have a template match to root '/' and then 
within this a <for-each> on all of the register nodes which 
calls the template .

To rule out the possibility of my template being called in 
the wrong place i did a few sanity checks when it was 
called -  like to display the current @name of the register
and also some details of the first Bitfield[1] etc...
(shifter has also been tested independantly and returns 
valid results).

I mean looking at the choose statement itself, should this 
behave as you can see -  by processing up to and including 
the last <bitfield> node, and then stopping displaying the 
results?

Is there any problems that spring to your mind that I can 
explore? The only conclusive problem that I can see is the 
<choose> statement is not valid, but again I have reviewed 
a lot of material and the conditional statement seems to be 
what I need?


Thankyou 

PD

 



On Fri, 4 Oct 2002 15:06:20 +0100 David Carlisle 
<davidc@xxxxxxxxx> wrote:

> 
> > 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
> 

----------------------
Peter Doggett
ee99ppd@xxxxxxxxxxxx


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.