Re: How to get the number of the father

Subject: Re: How to get the number of the father
From: David_Marston@xxxxxxxxx
Date: Thu, 9 Nov 2000 11:17:52 -0500
Frederic Schwebel wrote:
>So I need to know in my "template match='section'" if the parent of this
>section is the current section. I think I can achieve it with xsl:number,
>but I don't know how.

It looks to me like you are confusing xsl:number with the generate-id()
function, which is intended to provide a node identification that will be
constant for the duration of the transformation.

Rule of thumb: think of xsl:number as an output tool. If you want to use
it when setting the value of a variable, you should develop instinctive
skepticism about the whole approach. Even if it works in a variable,
there's probably something better. You speculated that count(some-path)
might do the trick, which shows signs of the well-founded skepticism
about xsl:number.

Also consider a select qualifier on the apply-templates, so that you're
only processing "section" children of the current node.
.................David Marston


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread