W3C home > Mailing lists > Public > www-tag@w3.org > July 2002

Re: QNames and the XPointer namespace scheme

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Mon, 8 Jul 2002 15:13:34 -0400
Message-Id: <p04330104b94f91fa0d0b@[192.168.254.4]>
To: Norman Walsh <Norman.Walsh@Sun.COM>, www-tag@w3.org
Cc: www-xml-linking-comments@w3.org

At 1:39 PM -0400 7/8/02, Norman Walsh wrote:
>/ Elliotte Rusty Harold <elharo@metalab.unc.edu> was heard to say:
>| At 12:33 PM -0400 7/8/02, Norman Walsh wrote:
>|
>|>XPointers in a document do use the in-scope namespaces. One could also
>|>use the xmlns() scheme in those pointers (because they aren't
>|>forbidden), but it's never necessary to do so.
>|
>| Actually, they don't. They only use the xmlns() schema mappings.
>| In-scope namespaces from the parent and ancestor elements do not apply.
>
>That's not what the impression I get when I read the CR[1]:
>
>    ...
>    This evaluation is carried out within a context identical to the
>                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    XPath evaluation context, except for the generalization of nodes to
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    locations. XPointer applications must initialize the evaluation
>    ^^^^^^^^^
>    context as described in this section before evaluating an XPtrExpr.
>

What that means is that the XPointer context is the same as the XPath 
context. However, there's nothing in XPath that says the namespace 
bindings are necessarily set by the xmlns attributes in the document 
where the XPath expression appears. That's an XSLT thing.

>So all the in-scope namespaces are there. Later it says:
>
>    ...
>    A set of namespace declarations, described in 5.2.1 Namespace 
>Initialization .
>
>which I take to mean that the xmlns() scheme bindings are also there.
>But I still don't think they're necessary.

I read that as indicating that only these bindings are available. I 
see nothing in the XPointer spec that indicates the xmlns attributes 
apply to XPointers.

I remember fairly clearly when XPointer got kicked back to working 
draft because of this issue, it was stated that only xmlns() scheme 
parts could be used in XPointer.

I also note that the previous draft from January 8, 2001 stated:

The evaluation of the following XPointer appearing in a non-XML 
document (or in an XML document with no declaration of the namespace 
prefix x) will result in a sub-resource error; it cannot be known 
which a element is desired because no namespace declarations are in 
scope:

However, in the latest CR draft we now have:

Evaluation of the following XPointer will fail; it cannot be known 
which a element is desired because no namespace declarations are in 
scope:

There's no longer any qualification about the XPointer appearing in a 
non-XML document. It fails no matter where it appears.

Also note, that there's no discussion of what happens when an xmlns() 
part conflicts with an xmlns attribute. This would be necessary if 
both were allowed.

Admittedly, the spec could be clearer on this point.

>I think XPointer would be fundamentally broken if only xmlns()
>bindings were available in the XPointer.
>

That may be, but it is the intent of the spec. If you think that is 
broken, then you should submit your concerns to the XML Linking 
Working Group.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+
Received on Monday, 8 July 2002 15:18:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:47:09 GMT