Re: [xml] changing xpath context
- From: Stefan Seefeld <seefeld sympatico ca>
- To: xml gnome org
- Subject: Re: [xml] changing xpath context
- Date: Tue, 03 Dec 2002 21:37:02 -0500
Joe Eggleston wrote:
Which shows that //bar is searching from the document root rather than the
current "foo" node.
that's right. A single leading '/' means 'child of the root node', while
two subsequent '/' mean 'descendent of the root node'. Don't forget that
this notation is a shortcut. The canonical form for '/foo' would be
'/child::foo' and for '//foo' it would be '/descendant::foo'.
The abbreviated form for 'descendant::foo' would be './/foo'. Note the
leading '.', which you may (somewhat) compare to unix file system syntax.
has more explanation of this stuff...
] [Thread Prev