XQIB XQuery - error when trying to 'let' a variable -


my xquery knowledge pretty lacking i'm trying play around xqib (xquery in browser), setting variable errors

let $foo := "bar" 

...generates error

mxquery output following error during compilation: line 1, column 18: err:xpst0003 error while parsing fflwor expr: 'return' expected! let $foo := "bar"    error                         unknown.anonymous(unknown source) 

i've looked @ samples on xqib site, , seems let statements there in sub-routines, e.g. alerts or functions. suggest in xquery, code must live in function of sorts, rather free-standing?

for example, 1 of examples this, of course works:

b:alert(     let $x := <a><b>2</b><c>4</c></a>     return xs:string($x/b * $x/c) ) 

but this, altered version, doesn't.

let $x := <a><b>2</b><c>4</c></a> b:alert(     return xs:string($x/b * $x/c) ) 

what's latter? in advance help.

your return @ wrong position:

let $x := <a><b>2</b><c>4</c></a> return     b:alert(         xs:string($x/b * $x/c)     ) 

you need return if used (part of a) flwor-expression. let starts one, need return after it. haven't got 1 parameter, don't need (and neither allowed) put return here.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -