>
> 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 findthesetvalue
> 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
> _______________________________________________
> saxonhelp mailing list
> saxonhelp@...
> https://lists.sourceforge.net/lists/listinfo/s>; axonhelp
>
