Search code examples
xmlxsltxslt-2.0

XSLT 2.0: <xsl:number> "initialization"


Is there a way to "initialize" the sequence the xsl:number element produces?

For instance if number will produce the following output:

1  
1.1  
1.1.1

I would like that initializing it to 2 for instance it will produce the following result:

2  
2.1  
2.1.1

and so on...

Is there any chance or do I have to create my own function/template to achieve that?


Solution

  • I think http://www.w3.org/TR/xslt-30/#number has a start-at attribute but you would need to use Saxon 9.6 PE or EE and XSLT 3.0 for that.