|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] If Statements within an If Statement?David Carlisle davidc at nag.co.ukWed Apr 2 23:23:12 PST 2008
declare function local:main($search as xs:anyAtomicType*) as element()*
{
let $search := upper-case(request:get-parameter("search", ""))
this makes no sense, it's legal but so is writing 1+1-2 instead of 0.
Doing the above means that the argument to the function can never be
used, so why not declare it as a function with no arguments?
You defined $search as a function parameter then immediately mask that
with a new ariable of the same name, which makes the function parameter
inaccessible.
local:searchresult declares variables $a and $b which it never uses
for $doc in distinct-values($seq)
looks very suspiciou as well, do you really want to be basing your
sorting and uniquenes stests on the entire text of the elements,
ignoring all markup but including all the white space used for
indentation?
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
|






