This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to get the number of the father



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]