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

Re: Calling a template recursively

Subject: Re: Calling a template recursively
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 2 Jul 2004 12:34:20 +0100
sql select recurs
>           I am using following template to display a
> <br> tag 

Do you mean you want to insert a br element at that position?
If so you want to use the syntax <br/> in the stylesheet.

You have used
<xsl:text>&lt;br&gt; </xsl:text>
which does not insert an element at all it just inserts the five
characters < b r > that string of characters will not be written out as
a tag when the XSLT system outputs your result tree to a file.

aside from that the logic for terminating your recursion is faulty
$temp is the first 25 characters
but then you define $temp2 to be the characters of $temp from position
26 on, so this will always be empty. You want to use the original
$releaselevel parameter here not $temp.

finally in your parameter you have used @temp2 ie an attribute called
temp2 which is also most likely empty.

In fact you don't need either variable definition, instead of

   
                   <xsl:variable name="temp"
      select="substring($releaselevel,1,25)"/>
                   <xsl:value-of select="$temp"/>

you can use


                <xsl:value-of
select="substring($releaselevel,1,25)"/>


and instead of

                        
                           <xsl:variable name="temp2"
   select="substring($temp,26,string-length($releaselevel))"/>
                        <xsl:value-of select="$temp2"/>
                           <xsl:call-template name="normaliseString">
                                <xsl:with-param  name="releaselevel"
                     select="@temp2"/>

you can use

      <xsl:call-template name="normaliseString">
                                <xsl:with-param  name="releaselevel"
                     select="substring($releaselevel,26)"/>



and of course, instead of

   <xsl:text>&lt;br&gt; </xsl:text>


use

  <br/>

David

-- 
The LaTeX Companion
  http://www.awprofessional.com/bookstore/product.asp?isbn=0201362996
  http://www.amazon.co.uk/exec/obidos/tg/detail/-/0201362996/202-7257897-0619804


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.