Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2014, 06:27 PM
Registered User
 
Join Date: Nov 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a new set of ranges from a series of individual ranges

Greetings,

I'm trying to use XSLT 2.0 to create a new set of grouped ranges based on an aggregation of a set of non-contiguous individual ranges. What makes this more complicated is that my data values are in text nodes. Example:

Given a range of numbers as an individual set:
  1. 150-202
  2. 201-225
  3. 201-204
  4. 205-234
  5. 226-234

I'm trying to produce a new grouping based on the way the groups overlap:
  1. 150-200 (this is where group 1 starts and overlaps to group 2 & 3)
  2. 201-202 (this is where 1 & 2 overlap, and group 1 ends)
  3. 203-204 (this is where 2 & 3 overlap and 3 ends)
  4. 205-225 (this is where 4 starts and begins to overlap with 5)
  5. 226-234 (this is where 4 & 5 overlap and end)

The start and end point of the individual ranges form the boundaries.

My source data is formatted like this, as a text node:
<range>150-202, 201-225, 201-204, 205-234, 226-234</range>

I've been using an xsl:sequence to create a new sequence containing all the numbers of a range, so I can do compares against individual numbers in the entire range, if necessary.

I'm thinking along the lines of:
- Grab all the individual numbers from the entire group, remove duplicates, and form boundaries where the number sequence is interrupted. But this doesn't take into account overlap.

Help appreciated!
Thanks,
Michael Friedman





Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two different ranges SMI// Excel VBA 4 June 8th, 2009 03:39 PM
Date Ranges nbuckwheat Access 1 December 12th, 2005 12:45 PM
Copying ranges mtowle Excel VBA 2 November 2nd, 2005 06:35 AM
Select multiple ranges.... Mats Excel VBA 2 June 9th, 2005 08:01 AM
date ranges yuqlin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 December 23rd, 2004 05:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.