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

RE: Numbering: position() ?

Subject: RE: Numbering: position() ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 10 Jan 2007 10:52:17 -0000
RE:  Numbering: position() ?
1. The value of position() within an xsl:template depends on the position of
the node within the set of nodes selected by the select expression of the
corresponding xsl:apply-templates, which you haven't shown us.

2. You don't say what numbering you would consider correct. If you're
looking for multi-level numbering, try <xsl:number level="multiple"/>. If
you want single-level numbering, consider <xsl:number level="any"/>.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Sven Waibel [mailto:sven.waibel@xxxxxxxx] 
> Sent: 10 January 2007 10:41
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Numbering: position() ?
> 
> Hi,
> 
> i got following xml:
> 
> <book id="1">
> 	<page>
> 	<special>
> 		<page>
> 		<page>
> 	</special>	
> 	<page>
> 	<page>
> </book>
> 
> xslt:
> 
> 
> <xsl:template match="page">
> 	<xsl:value-of select="concat(concat(ancestor::book/$id, 
> '.'), position())"/> </xsl:template>
> 
> I got this numbering:
> 1.1
> 1.1
> 1.2
> 1.3
> 1.4
> 
> How can i achieve that the numbering is correct?
> 
> Thanks
> Sven

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.