Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Calling a template recursively

From: David Carlisle <davidc@--------->
To:
Date: 7/2/2004 1:34:00 PM
>           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
________________________________________________________________________


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent