[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: Thu, 10 Aug 2006 10:41:13 +0100
recursive call
>  I've made some changes according to what you've
> provided.  Now when the template is called I'm getting an unknown XSLT
> error.

unknown to the system or unkonown to you? (It's best to quote the error
exactly)


> I'm using Xalan as my parser.

Xalan is not a parser, you are probably using xerces as your parser,
xalan is the XSLT engine.

> <!-- How I'm trying to start the Recursive call -->
> <xsl:template match="floordoc">
> ...

a match template only says what to do if you applly templates to a
matching node, it doesm't by itself, cause any code to run.

<!-- The modified Recursive call -->
<xsl:template match="floordoc/bill/title" name="intro">

unless you have title elements in other places you can probably just
write

<xsl:template match="title" name="intro">

	<xsl:variable name="num" select="string-length(.)" />
when I suggested to use . here I was assuming that you were starting off
by applying templates to a title element and this templat ewill fire
becuase of the match attribute, in which case the current element would
be title and . would do the right thing, but for some reasdon you are
calling this by name from your floordoc template so in that case
the current node is floordoc. so . would select teh floordoc element not
title. I suspect you want to keep . here but get rid of teh
call-template in the floordoc template.

<xsl:value-of  select="substring(floordoc/bill/title/para/text(),
If the current node is title (or even if it is floordoc) then the xpath 
floordoc/bill/title/para/ will select nothing unless the current elemnt
has a floordoc child. You want . here.

					<xsl:value-of select="substring(floordoc/bill/title/para/text(),
same again

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.