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

Re: failed to find the right child node

Subject: Re: failed to find the right child node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 31 Aug 2006 17:08:04 +0100
right child of node
> No one replays my question by now. 
If you get no replies, normally it means that no one understood the
question, so just reposting doesn't really help.


there really isn't any need to keep passing the entire node set and
having a counter that you increment, just have a parameter that is
the nodes to be processed, typically you porcess $nodes[1] and then you
recurse on $nodes[position()!=1] and stop when $nodes is empty.

//fast_load_stream[position()=$index]"

means

/descendant-or-self::node()/fast_load_stream[position()=$index]"

so it selects every fast_load_stream that is the $index'th child of its
parent.

You want a global variable

<xsl:variable name="nodes" select="//fast_load_stream"/>
and then use $nodes[position()=$index]
or as I say, make $nodes a parmeter that contains one fewer node at each
iteration.

	<xsl:when test="fastloadStream/objects/channel_object" >
is always going to be false as the current node appears to be always /
which doesn't have a fastloadStream child element. 

It seems likely that the number that you are  trying to calculate is
obtainable just from a simple xpath count and doesn't require a
recursive template, but I'm not sure as I don't follow your description.
what output do you want from your posted input?

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.