Default namespaces in xmlns parts

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. 

This would be especially useful for pointing into XHTML documents. All XHTML
elements are in a default namespace. Most importantly many authors will be
writing and linking to XHTML documents without having a very deep (or perhaps
any) understanding of XML or namespaces. In fact, for this reason I'm tempted
to say that xpointer(//p[2]) should find the second p element in the document
in any namespace, or perhaps just the second unprefixed p element, regardless 
of mapping. However, that would be a much more radical change.  

-- 
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|               Java I/O (O'Reilly & Associates, 1999)               |
|            http://www.ibiblio.org/javafaq/books/javaio/            |
|   http://www.amazon.com/exec/obidos/ISBN=1565924851/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+

Received on Thursday, 1 November 2001 04:50:06 UTC