W3C home > Mailing lists > Public > www-xml-linking-comments@w3.org > October to December 2001

Re: Default namespaces in xmlns parts

From: Daniel Veillard <daniel@veillard.com>
Date: Thu, 1 Nov 2001 11:41:44 +0100
To: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Cc: www-xml-linking-comments@w3.org
Message-ID: <20011101114144.U5005@daniel.veillard.com>
On Wed, Oct 31, 2001 at 10:33:57AM -0500, Elliotte Rusty Harold wrote:
> I would like to propose that an xmlns part containing only a URI be understood
> as setting the default namespace for unprefixed element names in the XPointers
> xpointer parts. e.g. this would find all the svg rect elements in a document:
> 
>  xmlns(http://www.w3.org/2000/svg) xpointer(//rect)
>  
> This is not strictly necessary because you can always use a prefix in the
> XPointer even if the targeted document uses the default namespace. However,
> experience with XSLT has shown that many users find this confusing, and don't
> initially realize they can add a prefix for an element that doesn't have
> one in their documents. The ability to easily set a default namespace would
> help avoid this problem, and should not introduce any major problems in implementations. 

  Well, it would !
I implemented XPointer directly on top of XPath in libxml. All the parsing
and building of the expression tree is nearly unmodified XPath parsing code
also reused by my XSLT implementation.
But it's 100% clear from the XPath REC that //rect must only select elements
without namespaces at all, and not select elements from a default namespace.

This would make implementing XPointer on top of XPath, far far more difficult,
really ! I don't think we should go that way in the current implementation
state.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Received on Thursday, 1 November 2001 05:41:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 October 2009 08:39:43 GMT