[xquery-talk] Where Clause and XDT:Untyped Issues

Michael Kay mike at saxonica.com
Mon Feb 4 07:44:18 PST 2008


> 
>    To make sure I am on the same page as you are, are you 
> talking about the compare() function in XQuery? 

I was talking about the eq operator, but you could use compare() if you
prefer. Or even "=". Something like

id('010003-031') eq id('010003-057')

if those are two ads you believe to be duplicates.

Oh - I've just noticed your ID values aren't valid ID values - an ID can't
start with a digit. So change that to

//ad[@xml:id='010003-031'] eq //ad[@xml:id='010003-057']

> If I use 
> this, would this not mean that I have to know the exact head 
> element to call when I am executing the XQuery?

You're comparing whether <ad> elements are duplicates, not whether their
<head> elements are duplicates. Is that perhaps the source of your
confusion?
> 
>    As for the error you raised, I tried running the XQuery by 
> using declare boundary-space strip at the prolog section of 
> the XQuery, but it returned me with still two of the same 
> result for every single set that it has found. For the minor 
> differences, could there be others other than whitespace 
> differences within the source?

There could be all kind of things, for example a capital Latin A in one
versus a capital Cyrillic A in the other would not readily show up when
viewed on the screen. OK, perhaps that's unlikely - but I've no way of
knowing that. That's why I asked you to run the test.

Michael Kay
http://www.saxonica.com/



More information about the talk mailing list