Re: [xml] XPath Location Paths



On Fri, Apr 12, 2002 at 03:14:50PM +0100, Richard Jinks wrote:
If I understand the spec correctly, I'd think that as el1 is the root node,
"name(el1)" should return "el1" and "name(el2)" should return an empty
string, i.e. it assumes that the context node is the first child of the root
node, and not the root node itself.

I've tested this with a fresh install of libxml2.2-4-19 just to make sure
that none of my previous dips into the XPath source code have messed
anything up.

  The problem is as you noted how the current node is being initialized.
XPath was not designed to be used in isolation, and does not say anything
about this. Solution: initialize the context node if you want to use
the XPath primitives directly.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]