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

RE: collapsing number ranges

Subject: RE: collapsing number ranges
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 27 Aug 2004 09:31:54 +0100
sql number ranges
> Is there some easy way -- in XSLT 2.0 -- to handle in a general way 
> collapsing number ranges like:
> 
> 23-24 => 23-4
> 333-334 => 333-34
> 7777-7778 => 7777-78
> 

I can't tell from these three examples what your algorithm is. If the second
number were to contain all trailing digits that differ from those of the
first number, then it's doable - but I don't think there's an "easy way"
even then. You just have to work through the second string outputting each
digit only if the substring up to and including that digit differs from the
leading substring of the same length in the other number - which can
probably be done in 1.0 as easily as in 2.0.

Michael Kay

Current Thread

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
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.