Namespaces (Was: Re: [Xpath-ng] Thoughts on work products)

David Rosenborg darolst at pantor.com
Fri Nov 22 13:20:06 MST 2002


Hi Jeni,

> I thought that holding something as a node was quite a large overhead
> because of retaining node identity. But that's just a vague feeling
> and I can't remember where I picked it up from.

Umm, after doing a bit of homework, I'd say that namespace nodes
should go away (together with the namespace axis). I think the
query-datamodel is doing the right thing here, but I think we
should go one step further and remove them completely,
not offering them even for compatibility reasons. The incompatibility
isn't so bad in this case since it's reflected in the syntax by removing the
axis. I think the equivalent of xf:get-in-scope-namespaces and
xf:get-namespace-uri-for-prefix would cover all feasible use cases for
namespace processing.
And as you suggest, the interface might even get simpler using a list of lists.

> That solution would work if you weren't embedding XPath in XML, but
> currently, you're not allowed to do:
>
> Certainly that isn't an impossible thing to get around, whether by
> declaring namespaces within XPath or by introducing an extension
> attribute that declares namespaces in XSLT, but I'd be wary of
> solutions that *rely* on being able to do it.

I agree that we shouldn't be dependent on any host language,
hence my suggestion of adding namespace declaration primitives
to XPath NG, but still keep the ability to inherit declarations
from the host language if present.

Cheers,
David




More information about the Xpath-ng mailing list