[xquery-talk] Add value to result before a for loop

Andrew Welch andrew.j.welch at gmail.com
Wed Jul 18 12:13:22 PDT 2012


On 18 July 2012 20:08, David Lee <dlee at calldei.com> wrote:
> Prety sure you can avoid the text {} and ()  and just do
>
>
>
> "Id	Name",
>
>   for $i in $doc/item return
>
>      concat($i/id,  "	", $i/name)
>

you can reduce it down a little further:

for $i in $doc/item return concat(.....)

is the same as

$doc/item/concat(.....)

which is what I did earlier:

return string-join(('Id	Name', $doc/item/concat(id, '	', name)), '
')




-- 
Andrew Welch
http://andrewjwelch.com


More information about the talk mailing list