[xquery-talk] If Statements within an If Statement?

David Carlisle davidc at nag.co.uk
Wed Apr 2 22:45:49 PST 2008


let $a := collection("my")//ad//address[contains(upper-case(.),'BOY')],
$b := collection("xmldb:exist://db/cbml")//ad//p[contains(upper-case(.),'GIRL')]


So $a and $b consist of distnct nodes (they are clearly distinct as $a
consists of address nodes and $b consists of p nodes, but even if they
had the same names they would be distinct nodes in different documents,
so as posted several times before in answer to your earlier questuons
 ($a except $b)) is the same as $a
($a union $b) is the smae as ($a,$b) and
so 
($a union $b) intersect ($a except $b)
is just a long way of writing $a

Why do you have this confusing usage of defining $a and $b in both your
functions? and (unused) also at the top level?

the function local:main never uses its input parameter $search at all.


given that $d is running through a sorted list
order by $d
does nothing.



if (count($sorted_result) lt 1)
then
<p>Sorry, too many results returned

presumably you didn't intend to give a message of too many for a count
of 0

Of course it's not possible to run your code in the form you've posted
it with private collection URI, so these are just comments by eye.  I'd
have thought by now you'd have spotted that it's better to post runnable
code.

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. 
________________________________________________________________________


More information about the talk mailing list