xsl-list
[Top] [All Lists]

Re: [xsl] Reranging Numbers

2010-09-21 02:51:32
I guess I would try it in two steps:

* normalizing to a sequence like (1, 2, 3, 5, 6, 7, 8, 9, 11, 15)
* condensing to the desired output

The first step could be done with tokenize() and some regular expression magic.
I would try the second step with some clever xsl:for-each-group, I guess.

- Michael

Am 21.09.2010 um 09:09 schrieb Jeff Sese:

Hi,

If i have a node like:

<node>1, 2, 3, 5-8, 9, 11, 15</node>

How can I make it as:

<node>1-3, 5-9, 11, 15</node>

I'm using XSLT 2.0

Thanks,
-- Jeff



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>