creating and retrieving a sequence

Here should go questions about transforming XML with XSLT and FOP.
cshrileckha
Posts: 1

creating and retrieving a sequence

Wed Jun 10, 2015 8:19 pm

Hello oxygen team,

I have a requirement where I need to create a sequence starting from 2000...3000
and I need to retrieve the sequence in that order.
Suppose I retrieve the sequence now. It should display 2000 and when next time I retrieve it, it should display 2001. is this possible in XSLT?

Thanks.
adrian
Posts: 2395

Re: creating and retrieving a sequence

Thu Jun 11, 2015 11:33 am

Hi,

So, you are referring to a range of sequential numbers. If you need the actual sequence, you can simply use "2000 to 3000" in an XPath.
e.g. in a variable

Code: Select all

<xsl:variable name="sequence" select="2000 to 3000"/>

Or, you can use xsl:for-each to iterate over it:

Code: Select all

<xsl:for-each select="2000 to 3000">
  <xsl:value-of select="."/>
</xsl:for-each>
"." is the current context that within the for-each block holds the currently iterated number, 2000, 2001, and so on.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest