[xquery-talk] Can XQuery include the path to a node in it's
mhk at mhk.me.uk
Sun Nov 28 23:15:52 PST 2004
There is no built-in function that gets the path to a node. (One reason is
that for any node, there are many paths that reach it).
You'll find some XSLT solutions to this problem, which readily translate to
equivalent XQuery expressions, at
If you're using Saxon, you can use the extension function saxon:path()
> -----Original Message-----
> From: talk-bounces at xquery.com
> [mailto:talk-bounces at xquery.com] On Behalf Of padmapriya ayyagari
> Sent: 28 November 2004 22:00
> To: talk at xquery.com
> Subject: [xquery-talk] Can XQuery include the path to a node
> in it's answer?
> Could someone please tell me how to write an XQuery for getting the
> values for a given node in the document and also the whole path for
> that node in the answer to the XQuery?
> For example,
> If I say
> document("abc.xml")/site/catgraph/edge ,
> then XQuery simply returns the answer but does not include the path
> /site/catgraph/edge in the answer. Could someone please tell me how to
> do this?
> talk at xquery.com
More information about the talk