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

Re: Recursive call trouble

Subject: Re: Recursive call trouble
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 9 Aug 2006 21:08:25 +0100
ln recursive
<xsl:param name = "start">1</xsl:param>
<xsl:param name = "end">60</xsl:param>
<xsl:param name = "ln">1</xsl:param>


these are global parameters so they are usable in all templates but they
will always have these values. Incidentally it's much better to use teh
selct attribute on xsl:param or xsl:variable




<xsl:param name = "start" select="1"/>

would make $start be the number 1, instead of a result tree fragment
consisting of a root node with a child text node with value  the string
"1".


<xsl:template match="fdoc/bl/title" name="intro">
You want the parameters to be parameters of this template so move them
after this line.
This template will match title elements so (if you apply templates to
title elements) it will be executed with teh current node being title.

		<xsl:variable name = "num"
select="string-length(fdoc/bl/title/para/text())" />

This selects the flfoc/title/bl/title/para/text() decendent of teh
current title node,which I suspect is empty and you just want
		<xsl:variable name = "num" selct="string-length(.)" />
here (and other places where this xpath is used.





			<line number='$ln'>
you want 
			<line number='{$ln}'>
here otherwise each attribute will get the literal string $ln with the
{} syntax the expression will be evaluated

David

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.