qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] Duplicates/Distinct-Function


From: Per Bothner
Subject: Re: [Qexo-general] Duplicates/Distinct-Function
Date: Sat, 29 Nov 2003 16:40:08 -0800
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007

Sascha Opletal wrote:

I need some distinct-values function for node-values and attribute-values:

That's a little tricky.  As far as I can tell, there is no standard
Xquery function nor a Qexo function that lets you do so directly, so
you have to program it yourself.  The distinct-values function is
defined in terms of 'eq'.  'eq' on nodes performs "atomization",
which returns the "typed value" of the node.  If there is no schema
(and Qexo does not yet support schemas) then the typed value of an
element is its string value (as an untypedAtomic), which is the
concatenation of the text node decendants.  This may or more not
give you the result you want.

So you probably have to write your own function.  What you probably want
is something like the 'distinct-values' function I posted.  You'd want
to use the standard 'deep-equal' function instead of 'eq', but Qexo
doesn't implement 'deep-equal' yet either.  However, it is easy to
write a special-purpose "equivalent-nodes" function instead that
just compares the attributes and nodes that you consider significant.
--
        --Per Bothner
address@hidden   http://per.bothner.com/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]