[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: failed to find the right child 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|