[xquery-talk] Using axis in XQuery

Jeni Tennison jeni at jenitennison.com
Wed Dec 1 09:25:01 PST 2004

Hi Padmapriya,

> I need a function such that : For every node returned as an answer
> to an xquery which is a union of xqueries, I want the path from the
> root to that node in the document.

You could produce a sequence of strings containing the names, and use
the string-join() function to concatenate them together with /
separators. Creating the sequence of names is easy now that a path's
last step can create atmoic values:

  string-join($node/ancestor-or-self::*/name(.), '/')



Jeni Tennison

More information about the talk mailing list