Re: [xml] Default namespaces with XPath



On Thu, Dec 26, 2002 at 03:26:12PM +0100, Stefano Debenedetti wrote:
Can't you go:

/*[local-name()='presence']/*[local-name()='tuple']

  Well that doesn't have the same semantic as the initial expected query.

or even:

/*[local-name()='presence'][namespace-uri()='urn:ietf:params:xml:ns:cpim-pidf']/*[local-name()='tuple'][namespace-uri()='urn:ietf:params:xml:ns:cpim-pidf']

  Yup, that one work, but it's not pretty ...
Registering the namespace in the XPath evaluation context is less
portable but easier to understand. Note that the XPath specification
was not done with the expectation it would be used standalone but
always in a framework (XSLT and XPointer originally) which were 
defining the mechanism for the context initialization.

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]