[xquery-talk] Problem with SubFlowr-Expr

John Snelson john.snelson at oracle.com
Fri May 11 01:49:51 PDT 2007


This is an operator precedence problem - you need to enclose the two 
element constructors in the return expression with parentheses and use a 
comma operator to concatenate them into a sequence:

                 return (
                     <description>{$a/description/text()}</description>,
                     <review>This is the Error</review>)

John

florianwendland at freenet.de wrote:
> Hi all,
> I have some wierd problems with a xquery syntax. The query lokks like this:
> 
> declare variable $book external;
> declare variable $books external;
> 
> <Books>
>     {
>     for $bid in $book/books/book
>     let $b := $books/Import/Row
>     return
>         <Book>
>             <id>{$bid/id/text()}</id>
>             <ddd>jj</ddd>
>             {
>                 for $a in $b[xs:integer(./id/text()) eq 
> xs:integer($bid/id/text())]
>                 return
>                     <description>{$a/description/text()}</description>
>                     <review>This is the Error</review>
>             }
>         </Book>
>     }
> </Books>
> 
> 
> The Query could not be parsed, because after the element description, in 
> the subflowr, the parser expects an }. I didn't know, what ist wrong 
> with it! Can anyone help me? I would be grateful!
> 
> Thx
> mfw
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk



More information about the talk mailing list