[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Grouping without Duplicates Issues

Wei, Alice J. ajwei at indiana.edu
Mon Jan 28 16:42:51 PST 2008


  Grouping without Duplicates Issues
Hi, David:

   I am guessing you are referring to John Snelson's code. I have no issues using that to implement the rest of my code snippets, but I want to extract some more information with the code.
   Without $head in $doc/title added into the picture, I have all my results back, accurately. When I do add this snippet in, which is a small portion of what I wanted to do (I intend to retrieve results that have several contain() or other constraints into my query), I get this error:

Error while evaluating expression: [.......]
 cannot convert value of type xdt:untypedAtomic to a node set [at line 115, column 21] In call to function: sandbox:exec-query(xs:string) [129:10]

The revised query:

let $addresses := fn:collection("xmldb:exist://db/book")//booklist
let $sorted_result:=
   for $doc in distinct-values($addresses),
        $head in $doc/title
   where contains ($title, 'XQuery')
   order by $doc ascending
   return $doc
for $r at $count in $sorted_result
let $nodes := $addresses[. = $r]
return
   <bibl>
     <statistics>
       Showing Result: {$count} / {count($sorted_result)}
     </statistics>
     {$nodes}
   </bibl>

I had been using this code for a while, which it works, but I think I am having some issues with subqueries. This is why I revised the code to the one you saw in my post, so that it could retrieve something back.
Is this not even a subquery at all?

Thanks for your help.
======================================================
Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
http://x-query.com/mailman/listinfo/talk



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.