Subject: QUESTION about xsl:number From: Kelvin Zheng <kzheng@xxxxxxxxxxx> Date: Thu, 4 May 2000 13:21:39 -0700 |
Hello, New to this list. I am currently working on a style sheet to display a XML document with numbering list. For a simple numbering, xsl:number works perfectly. But in our case, we want to skip some of the sibling nodes depends on the type attribute of the node. A sample document: <document> <section type="title" shownumber="no"> XML sample </section> <section type="index" shownumber="yes"> Definition <definition> XML </definition> <definition> XSL </definition> </sectioin> <section type="index" shownumber="yes"> Implementation </sectioin> </document> I would like to number the sections based on attribute "shownumber. The sample document will be displayed as: XML 1. Definition 2. Implementation based on the XSL: <xsl:choose> <xsl:when test="@shownumber[.='no']"> </xsl:when> <xsl:otherwise> <xsl:number format="1. " count="section[@shownumber='yes']" /> </xsl:otherwise> </xsl:choose> My question is how to number its child nodes as: XML 1. Definition 1.1 XML 1.2 XSL 2. Implementation I have tried <xsl:number level="multiple" format="1. " />, but the document looks like: XML 1. Definition 1. XML 2. XSL 2. Implementation It will be nice if someone can help me out. Thank you in advance. Regards, Kelvin XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: 'unique' element query, Kay Michael | Thread | Re: QUESTION about xsl:number, G. Ken Holman |
Re: Escaping for use in URLs, ed billings | Date | RE: IE 5.0 Mac, FileMaker Pro, & HT, Roger W Jacques |
Month |