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

Re: xsl:number

  • From: Jeni Tennison <mail@j...>
  • To: Adnan Zelkanovic <a.zelkanovic@a...>
  • Date: Fri, 17 Aug 2001 10:10:09 +0100

xsl number
Hi Adnan,

XSLT questions are best address to XSL-List at
http://www.mulberrytech.com/xsl/xsl-list.

> i'm trying to set the start value number 2 with xsl:number, but it
> don't work.
> Is the syntax [<xsl:number level="any" from="2" format="1"/>] wrong.

Yes, the syntax is wrong. The from attribute needs to take a pattern -
it looks for the closest node matching that pattern and numbers nodes
starting from that one.

You have to count the nodes yourself to do that, although you can
still use xsl:number's number formatting facilities. I think you
probably need something like:

  <xsl:number value="count(preceding::foo | ancestor::foo) + 2"
              format="1" />

You should replace 'foo' with the name of the elements you're
numbering (assuming they're elements, or a node test for the nodes
you're numbering if they're not elements). Preferably you should
replace the path with something that's more specific - for example,
take out the count of ancestors unless you need to count ancestors.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


  • References:
    • xsl:number
      • From: Adnan Zelkanovic <a.zelkanovic@a...>

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.