[xquery-talk] "XQuering"

Frank Cohen fcohen at rainingdata.com
Wed Sep 21 13:07:51 PDT 2005


Thanks for catching my mistake. -Frank



On Sep 21, 2005, at 8:50 AM, Devineni, Srinivasa (LNG-DAY) wrote:

> Hi Frank,
>
> The below will return a sequence of 1's and not a count.
>
> The query can be changed to get a count as below -
>
> count(
>     for $f in doc("xqnow1.xml")/root/item
>            where count($f/subitem)>0 and count($f/metaitem)>0
>     return $f
> )
>
> Or a straight xpath as Michael Kay mentioned can be used.
>
> - Srini
>
>
> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On  
> Behalf Of
> Frank Cohen
> Sent: Saturday, September 17, 2005 2:12 AM
> To: eduardoelarrat at gmail.com
> Cc: talk at xquery.com
> Subject: Re: [xquery-talk] "XQuering"
>
> How about this? -Frank
>
>
> for $f in doc("xqnow1.xml")/root/item
>    where count($f/subitem)>0 and count($f/metaitem)>0
> return count($f)
>
>
>
>
>
>
>
> On Sep 16, 2005, at 9:16 PM, Elarrat, EFC wrote:
>
>
>
>> Hello everybody. Lately I've been trainning some xqueries and I
>> guess I'm learning a lot about it. But, as the novice I am, I need
>> some help of you, though. I tried to do a query, but I realized I
>> couldn't do it with my limited knowledge on the subject, so here I  
>> am.
>>
>> What I'm trying to do is the following:
>>
>> I have this XML structure:
>> <root>
>> <item>
>> <subitem>textaboutsomething</subitem>
>> <metaitem>metatextaboutsubitem</metaitem>
>> </item>
>> </root>
>>
>> And I would like to build a query that brings me the number of
>> times that the subitem X comes with the metaitem Y. Anybody could
>> help me? Thanks everybody for your big attention.
>> _______________________________________________
>> talk at xquery.com
>> http://xquery.com/mailman/listinfo/talk
>>
>>
>
>
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
>
>




More information about the talk mailing list