This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27060 - [xslt 3.0] xsl:number level="multiple" start-at="3"
Summary: [xslt 3.0] xsl:number level="multiple" start-at="3"
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-15 15:50 UTC by Michael Kay
Modified: 2015-10-29 09:50 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2014-10-15 15:50:09 UTC
This is prompted by a suggestion on StackOverflow to use xsl:number/@start-at where it doesn't actually do what the respondent wanted to achieve, namely (b) below.

There are three potential uses for start-at with level="multiple".

(a) where you want numbering at every level to start at zero, e.g.

0.0, 0.1, 0.2, 1.0.0, 1.0.1 etc

(b) where you want the top-level number to start at something greater than one, typically because you are only processing one chapter of a document:

3.1.1, 3.1.2, 3.2., 3.2.1 etc

(c) where for some reason different levels start at different points, e.g.

1.x, 1.y, 1.z

1.0.1, 1.0.2, 1.1.1, 1.1.2

Our current spec only allows for (a). People might be a little surprised if they say level="multiple" start-at="3" and get

3.3.3, 3.3.4, 3.4.3, 3.5, 3.6.3

when they were expecting

3.1.1, 3.1.2, 3.2.1, 3.3, 3.4.1

I think it would be much more useful to specify a list of numbers, representing the start point for each level. Corresponding to the existing convetion for the format attribute, if the list is shorter than the number of levels, the last number in the list would be used (which falls back to the current spec if there is only one number in the list).

So for (a) you would specify start-at="0", for (b) you would specify start-at="3.1", for (c) you would specify start-at="1.24". (Or we could be more friendly and make it start-at="1.x", i.e. use the formatted representation rather than the unformatted).
Comment 1 Michael Kay 2014-10-15 15:50:56 UTC
For reference, the question that prompted this is here:

http://stackoverflow.com/questions/26380276/xslt-2-0-xslnumber-initialization
Comment 2 Michael Kay 2014-10-23 21:37:43 UTC
The proposal was accepted; start-at should be a sequence of integers, one for each level in the sequence of numbers to be formatted.

(Note that this was part of the original proposal when the facility was introduced in bug #8402, but at some stage the idea was lost)