views:

38

answers:

0

Hi,

I want to compare the elements on a list using XQuery. For this I'm thiking about using two for loops nested. Something like this:

for $i in $node[*[name(.)=$dN][data(.)!=""] and *[name(.)=$hN][data(.)!=""]] 
    return 
    {
        for $j in $node[*[name(.)=$dN][data(.)!=""] and *[name(.)=$hN][data(.)!=""]] and $j != $i
            return 
    }

What I want to compare is the concatenation of various elements inside each element (date+time) and after all the process is done I would know which date+time is more frequent.

It's my frist time with XQuery and I don't know an efficient way of doing this. Is there any efficient way of doing this?

Thanks in advance.