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

QUESTION about xsl:number

Subject: QUESTION about xsl:number
From: Kelvin Zheng <kzheng@xxxxxxxxxxx>
Date: Thu, 4 May 2000 13:21:39 -0700
kelvin zheng
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

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.