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]

QUESTION about xsl:number


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

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