# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## saxon-help

 [saxon] Defining numeric sets in xPath2.0? Set containment? From: Roger L. Costello - 2003-07-19 20:53:33 ```Hi Folks, This question is perhaps a bit out in left field I'm afraid, but I'll give it a go nonetheless... xPath is very accustomed to dealing with sets of nodes. It doesn't seem too much of a stretch then to think that it could also deal with sets of numbers. For example, consider this set definition: {k, m | k = m * 1.62} "The set of all k (kilometer) and m (mile) such that k equals m times 1.62" Thus, this represents the set of all equivalent kilometer/mile pairs. Question: is there a way to express this set in xPath 2.0? To extend this example, suppose that I wanted to test to see if a specific kilometer/mile pair is in the set: (6300, 3914) in {k, m | k = m * 1.62} Question: is there a way to express this set containment in xPath 2.0? Going still further, it would be wonderful to provide one value and get the corresponding value back: (6300, ?) in {k, m | k = m * 1.62} Question: is there a way to express this find-the-set-value in xPath 2.0? /Roger ```
 RE: [saxon] Defining numeric sets in xPath2.0? Set containment? From: Michael Kay - 2003-08-04 07:55:47 ```> > This question is perhaps a bit out in left field I'm afraid, > but I'll give it a go nonetheless... > > xPath is very accustomed to dealing with sets of nodes. It > doesn't seem too much of a stretch then to think that it > could also deal with sets of numbers. For example, consider > this set definition: > > {k, m | k = m * 1.62} > > "The set of all k (kilometer) and m (mile) such that k equals > m times 1.62" > > Thus, this represents the set of all equivalent kilometer/mile pairs. (I thought a US mile was the same as an Imperial (British) mile, which is 1.609344 Km. Am I wrong?) > > Question: is there a way to express this set in xPath 2.0? You are asking for two things: (a) sets of atomic values (b) infinite sets Sets of atomic values aren't supported directly in the data model, but can be simulated by defining appropriate functions on sequences. I think there's an appendix to the F&O spec that gives sample functions for finding the intersection or union of two such sets represented by sequences. There is no support for infinite sets. The problem you are describing is best modelled using a pair of functions, one of which is the inverse of the other. Michael Kay > > To extend this example, suppose that I wanted to test to see > if a specific kilometer/mile pair is in the set: > > (6300, 3914) in {k, m | k = m * 1.62} > > Question: is there a way to express this set containment in xPath 2.0? > > Going still further, it would be wonderful to provide one > value and get the corresponding value back: > > (6300, ?) in {k, m | k = m * 1.62} > > Question: is there a way to express this find-the-set-value > in xPath 2.0? > > /Roger > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a > single machine. WITHOUT REBOOTING! Mix Linux / Windows / > Novell virtual machines at the same time. Free trial click > here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > saxon-help mailing list > saxon-help@... > https://lists.sourceforge.net/lists/listinfo/s>; axon-help > ```