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

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)
father number son number
Hello,

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>
      <text>lnjlj</text>
      <image src=.... />
      <section title=ghkfghkgf>
        [other tags, and mybe other section]
      </section>
    </SECTION>
</CHAPTER>

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
it...



Thanks in advance

Frederic

PS : you can get my XSL sheet transforming Presentation MathML into french
braille at http://handy.univ-lyon1.fr/projets/bramanet/

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:  http://www.mulberrytech.com/xsl/xsl-list


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.