Re: [xml] XPath question
- From: Daniel Veillard <veillard redhat com>
- To: Jesse Pelton <jsp PKC com>
- Cc: xml gnome org, Ed Day <eday obj-sys com>, Igor Zlatkovic <igor zlatkovic com>
- Subject: Re: [xml] XPath question
- Date: Wed, 4 Aug 2004 14:53:03 -0400
On Wed, Aug 04, 2004 at 01:26:01PM -0400, Jesse Pelton wrote:
I think the operative thing here is, "Assuming foo is mapped to your
namespace name in the XPath context." I probably should have mentioned
in my posting that I came up with my expression to deal with
environments where there was no mechanism to establish such mappings
other than by including a namespace prefix in the instance document. As
far as I can see, XPath 1.0 does not specify such a mechanism, but
http://www.w3.org/TR/xpath#section-Conformance
"XPath is intended primarily as a component that can be used by other
specifications. Therefore, XPath relies on specifications that use XPath
(such as [XPointer] and [XSLT]) to specify criteria for conformance of
implementations of XPath and does not define any conformance criteria
for independent implementations of XPath."
In a nutshell, XPath was not supposed to be used in isolation. It was left
to the other specifications using it (XSLT and XPointer) to state how
they allowed to set namespace mapping in the evaluation context. Both XSLT
and XPointer do, that mechanism is expected to be provided but XPath doesn't
define how, precisely because it was designed to be embedded.
libxml does, of course. So, my posting was not completely relevant to
this list. I was excited to find a solution (even if inefficient) to a
real problem that I had; I hope I can be forgiven for choosing the wrong
forum to share it!
I would expect *any* XPath implementation to provide the mapping
between prefixes and namespace name as the mapping is part of the
XPath evaluation context -last item in the bulleted list:
http://www.w3.org/TR/xpath#section-Introduction
It is somewhat mandatory since it is needed to parse the XPath expressions.
It is not a matter of relevance or wrong forum. Let's say I got irritated
by the fact you pointed as wrong a correct and clean solution and suggested
instead a relatively cumbersome and not readable one. Anybody can misunderstand
those specs, they are complex it happens all the time, not a big deal,
but I have to point out what the spec really states and mean.
Daniel
--
Daniel Veillard | Red Hat Desktop team http://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]