0
votes

Im trying to output multiple things on XQuery from a xml file.

for $foo in doc("foo.xml")//foo/who
return $foo
for $bar in doc("bar.xml")//bar/too
where $foo/name=$too/name
return $too/title

so i can return $foo if i remove the other for section. if i remove the $foo i can return the $too/title.

i also cant figure out a way to return multiple from one return

return $too/title
           $too/name
           $too/date

does not work

1

1 Answers

-1
votes

Try this: return ($too/name, $too/title) etc. Remember you are returning a sequence, which can be 0 (), one ($var) or more ($one,$two) items. Just put them between () and separate with ,

Success