|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Where Clause and XDT:Untyped IssuesMichael Kay mike at saxonica.comSat Feb 2 09:57:37 PST 2008
You haven't shown the source document so it's difficult to diagnose. The
only thing that makes me nervous about your code is that you first do
distinct-values($ad)
which atomizes items in $ad, and then you do
contains($ad/head,'Baseball')
which looks for children of items in $ad. It's unusual to atomize something
that has children, which makes me suspicious.
Michael Kay
http://www.saxonica.com/
_____
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Wei, Alice J.
Sent: 01 February 2008 22:31
To: http://x-query.com/mailman/listinfo/talk
Subject: Where Clause and XDT:Untyped Issues
Hi,
I believe I have been passing this question through, but I think my main
question about not been able to put in a where clause in my XQuery after my
second let statement has been declared. In return, I receive all retrieved
results is the issue.
The code below has been modified from one of the members' inspirations.
Apparently, no matter what I do, it appears that the where clause in the
$sorted_result has never been taken into the output generation. When
executed the script, it gives me back everything, whether or not the word
"baseball" was in the head. I have 197 distinct values in my list.
let $ad := fn:collection("xmldb:exist://db/my")//ad
let $sorted_result:=
for $doc in distinct-values($ad)
where contains($ad/head,'Baseball')
order by $doc
return $doc
for $r at $count in $sorted_result
let $nodes := $ad[. = $r]
return
<ad>
<statistics>
Showing Result: {$count} / {count($sorted_result)}
</statistics>
{$nodes}
</ad>
What I want here is just something simple, I want to be able to put in some
form of where clause so I can eliminate more of my current result output.
Any hints on this would be appreciated.
======================================================
Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080202/7cf750c2/attachment.htm
|
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
|






