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( 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 | | Writer/Programmer |
|               Java I/O (O'Reilly & Associates, 1999)               |
|              |
|   |
|  Read Cafe au Lait for Java News:      | 
|  Read Cafe con Leche for XML News:     |

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