RE: FW: DN-FO-09: 15.1.11 fn:distinct-values

Thank you.

The most frustrating in writing such comments is that what a user finds useful and
logical is considered not to have a strong use-case. 

On the other side the distinct-values function returning its result in
implementation defined order is really of little use.

What is the use of a function, if you cannot give even one example of its
application and the result it must return? At the moment, the best that may be
provided is a *possible result*.

The existence of such function definitions, which do not define the result of the
function in a precise manner (e.g. "... is implementation defined") is not a good
feature of this document.

Such behaviour also does not answer any real need, but as was explained by Michael
Rys in http://lists.w3.org/Archives/Public/public-qt-comments/2003Jun/0206.html

this definition of the function is due only to efficiency considerations.

If this could help, there is a function "distinct" defined in the "sets" module of
EXSLT and implemented for the most popular XSLT 1.0 processors.

Its definition can be found at http://exslt.org/set/functions/distinct/index.html
and is as follows:

"node-set set:distinct(node-set)

The set:distinct function returns a subset of the nodes contained in the node-set NS
passed as the first argument. Specifically, it selects a node N if there is no node
in NS that has the same string value as N, and that precedes N in document order. "

I still hope that a useful distinct-values function can be specified in a next
version of this document.

Dimitre Novatchev.


--- Ashok Malhotra <ashokma@microsoft.com> wrote:
> You are correct; document order is only defined for nodes.  My mistake!
> I understand the semantic you desire but there is not a strong usecase
> for it.  For most purposes the order-by clause provides the required
> function.
> 
> All the best, Ashok
> 
> > -----Original Message-----
> > From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> > request@w3.org] On Behalf Of Dimitre Novatchev
> > Sent: Friday, July 25, 2003 2:34 PM
> > To: public-qt-comments@w3.org
> > Cc: dnovatchev@europe.com
> > Subject: Re: FW: DN-FO-09: 15.1.11 fn:distinct-values
> > 
> > 
> > > We have clarified the text to indicate that order of the output
> sequence
> > if
> > > implementation dependent.  We have also changed the wording of the
> > example
> > > as you suggested.
> > 
> > Thank you.
> > 
> > >
> > > If the user wants the output in a particular order, he can sort the
> > values
> > > by document order by using $x/. or in any other order by using the
> > order-by
> > > clause.
> > >
> > > Please let us know if this is satisfactory.
> > 
> > Document order is defined for nodes. We may want to preserve the
> *sequence
> > order*
> > between the distinct elements that would be returned.
> > 
> > The example I gave before:
> > 
> > I have the following sequence of random numbers:
> > 
> > 3, 5, 2, 8, 6, 4, 9, 7, 1, 5, 2, 10, 9, 3
> > 
> > I want to get only the (first occuring) distinct numbers with their
> > ordering
> > preserved:
> > 
> > 3, 5, 2, 8, 6, 4, 9, 7, 1, 10
> > 
> > This could be possible if the distinct-values() function was defined
> with
> > an
> > additional argument "preserve-order" (possibly with default value of
> > false).
> > 
> > 
> > fn:distinct-values($srcval as xs:anyAtomicType*,
> >                    $preserve-order as xs:boolean? ) as
> xs:anyAtomicType*
> > 
> > 
> > Cheers,
> > Dimitre Novatchev.


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Received on Friday, 25 July 2003 18:22:16 UTC