How to get the number of the father

Subject: How to get the number of the father
From: Frédéric SCHWEBEL <schwebel@xxxxxxxxxxxxxxxx>
Date: Thu, 2 Nov 2000 17:26:26 -0400 (EST)

Sorry to ask again, but I can't figure out how to do this :

I have an XML file with chapter (root element) and sections :
<CHAPTER TITLE=sdfsdfsdfsd>
   <SECTION TITLE=sdfsdfs>
      <image src=.... />
      <section title=ghkfghkgf>
        [other tags, and mybe other section]

What I want to do is always call the same xml file with number of the
current section as a parameter to display what I want.

What I want to do is :
- If there's no parameter, show the chapter number and a summary links to
the direct sub-sections (the direct sons).
- If there's a parameter, output the (facultative) content of the section
and a summary with links to all direct sub-sections (direct sons), but not
the sub-sub sections and so on...

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.

I get the current section number like that :
<xsl:number level="any" format="1"/>

Iget the "structured" number like that :

<xsl:number level="multiple" format="1.1"/>

And to get the section number of the father, I thought I could do sth like :

<xsl:number level="any" from="parent::*" format="1"/> but Xalan tells me
that only attribute and child axes are allowed here.

Maybe I could get this with a count(parent and all preceding-sibling,
descendant and ancestors that are "section"), but I can't figure how to do

Thanks in advance


PS : you can get my XSL sheet transforming Presentation MathML into french
braille at

PPS : thanks A LOT to DaveP for his XSL FAQ which prevented me from asking
many many questions on the list :)

 XSL-List info and archive:

Current Thread