W3C home > Mailing lists > Public > www-xml-linking-comments@w3.org > January to March 2004

xml:base error handling

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Wed, 14 Jan 2004 10:38:28 -0500
Message-Id: <p06010207bc2b106ecfd8@[192.168.254.4]>
To: www-xml-linking-comments@w3.org
Cc: xml-dev@lists.xml.org

I've just noticed that the handling of errors in xml:base attributes 
is disturbingly unspecified in the XML Base spec, and it's causing me 
some problems. For example consider this document which, for the sake 
of argument, let us say is loaded from http://www.example.org/:

<root xml:base="http://www.red.com/">
   <child xml:base="  http: //www.green.org/%GG/%z/%8???###  ">data</child>
</root>

Although many strings are syntactically correct URIs (especially 
given that xml:base allows non-ASCII characters, which are escaped 
calculating the URI) I hope it's obvious that there are well-formed 
values of xml:base which are not legal URIs, such as in the child 
element above.

What is the base URI of the child element? According to the XML Base 
spec, the base URI of an element is "the base URI specified by an 
xml:base attribute on the element, if one exists". However, in this 
case (and many others) the xml:base attribute exists but it does not 
provide a URI.

Possibly the problem is grammar, Does  the "one" in "if one exists" 
refer to the URI, not the xml:base attribute? If so the base URI of 
child is http://www.red.com/. But you could also argue that it has no 
base URI, or that the base URI is http://www.example.org/. I suspect 
implementations vary.

Does anyone know what the intent was in this case, if indeed there 
was intent at all? It's possible the working group did not consider 
this possibility. However, this is resolved, I think an erratum is 
needed to clarify the proper handling of non-URIs that occur in 
xml:base attributes.
-- 

   Elliotte Rusty Harold
   elharo@metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml            
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA 
Received on Wednesday, 14 January 2004 10:42:08 GMT

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