[xquery-talk] position() and last()

R. Mark Volkmann mark at ociweb.com
Tue Aug 31 23:15:04 PDT 2004

I know how to use these functions in XSLT, but I haven't figured out how to
use them in XQuery.
For example, suppose I want to put a comma between items, but not after the
last one.
I could do something like this.

for $i in $items
return (
  if (position() = last()) then () else ","

This doesn't work. What am I doing wrong?

More information about the talk mailing list