[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Problem with "let" statements in an xquery function

Ignacio Tripodi ignaciot at gmail.com
Tue Aug 12 17:45:43 PDT 2008


  Problem with "let" statements in an xquery function
Hi,

I'm puzzled about this function I'm working on:

declare updating function
       do_stuff
(
       $a as element(),
       $b as xs:string
)
{
       let $c := $a//some_element[.=$b]/..[another_elem='foo']
       let $d := $a//anoher/element

       return
       if( exists($c) )
       then
               replace value of node $c/xxx with $d
       else
               ()
};

The problem is, those "let" statements aren't working... if I check the
value of $c or $d they're null. And the xpath expression I'm using is valid.
Based on the W3 specs I understand those "let" declarations are valid:

http://www.w3.org/TR/2008/CR-xquery-update-10-20080801/#doc-xquery-FunctionDecl

What am I missing? Should I assign those variables in some other way? I
tried using "declare variable" instead but that didn't work either.
Thanks for any comments, I think I could use an extra pair of eyes. :-)

-i
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080812/74832af0/attachment.htm


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.