[xquery-talk] A walk down Sesame St - counting for simpletons

Ihe Onwuka ihe.onwuka at gmail.com
Tue Apr 8 14:18:18 PDT 2014


http://exist.2174344.n4.nabble.com/counting-bug-td4664056.html

On Tue, Apr 8, 2014 at 5:17 PM, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:
> I'm not creating a collection as I've already exceeded my allocated
> time for talking about this. However I can oblige with a slightly
> edited screen print of query and result. The answer is at the bottom.
> The eXist people read the list, it was run on their XQuery processor
> so perhaps they may want to comment.
>
> I am finito here.
>
> NewNew XQueryOpenSaveCloseRunCheck
>
> countM.xq*
> new-document 1*
> new-document 2
>
> 1
> 2
> 3
> xquery version "3.0";
> (collection('/db/apps/spark/data/rtUnmatched')//thing,collection('/db/apps/spark/data/rtID')//thing)/count(.)
> /db/apps/spark/programs/countMovies.xq
>
> Outline
>
>  Live Preview
> Showing results 1 to 1 of 1
> 87567
>
> On Tue, Apr 8, 2014 at 5:05 PM, Andrew Welch <andrew.j.welch at gmail.com> wrote:
>> Happy to be the plonker if I'm wrong but:
>>
>> ($seq)/count(.)
>>
>> will only ever produce a sequence of 1s (or 0 when $seq is empty)...
>>
>> If you are saying otherwise please provide small complete runnable
>> sample so I recreate it.  (and please really do provide an actual
>> sample of runnable code that really does show it)
>>
>>
>>
>> On 8 April 2014 16:50, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:
>>> ....but that my dear plonker..... does not return a stream of ones......Oops!
>>>
>>> On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch <andrew.j.welch at gmail.com> wrote:
>>>>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.)
>>>>
>>>> ^^^ that constructs a sequence of <elem>s, and then supplies each one
>>>> to the count() function... so it will just a return a load of 1s.
>>>>
>>>> Bonney dee doosh, ala quet de mer, rodders.
>>>>
>>>> --
>>>> Andrew Welch
>>>> http://andrewjwelch.com
>>
>>
>>
>> --
>> Andrew Welch
>> http://andrewjwelch.com


More information about the talk mailing list