|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Grouping without Duplicates IssuesDavid Carlisle davidc at nag.co.ukMon Jan 28 21:09:59 PST 2008
again you have posted code that calls distinct-values on a sequence of length 1. This is not a synatx error but it will never do anything useful,. for $book in fn:collection("xmldb:exist://db/library")//book, so $book will (repeatedly) be bound to a _single_ book node. That is always the case with a for clause. for $doc in distinct-values($book) distinct-values($book) is given a single node so it will return a single value, which is the string content of the entire book. for $r at $count in $sorted_result this is a for loop over a sequence of length 1, so $count will always be 1. People have already posted in this thread the idiom you need to use distinct-values to do grouping in xquery. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






