[HTML5] xml:base

Simon Pieters zcorpan at gmail.com
Thu Mar 8 11:36:52 PST 2007

On Thu, 08 Mar 2007 19:49:16 +0100, Keryx Web <webmaster at keryx.se> wrote:

> 1. Is the xml:base attribute allowed in XHTML 1.0?
> I thought so, but http://www.w3.org/TR/xhtml1/#strict says it is not in
> the sense that if I use it my document is not "strictly conforming".
> however one of the main points of using XML is the option of namespaces.
> It may not be "strictly conforming" according to the DTD, but it is
> strictly according to the philosophy of XML.
> The spec also says that one *may* use it with other namespaces:
> "3.1.2. Using XHTML with other namespaces
> The XHTML namespace may be used with other XML namespaces as per
> [XMLNS], although such documents are not strictly conforming XHTML 1.0
> documents as defined above. "

I think this could be interpreted in two ways.

(1) The XHTML namespace may be used with other namespaces, but then you  
will only conform to Namespaces in XML, not XHTML 1.0.

(2) There is an implied concept of loosely conforming XHTML 1.0 documents.

> 2. If I use the <base> element to specify one base url and the attribute
> to specify another - admittedly bad design - which one should win over
> the other? Testing in FFox the attribute does.

They don't conflict.

<base> specifies the document's base URI. Try  

xml:base specifies the element's base URI. Try  

> Simon Pieters kindly answered that one could use the together, i.e.
> specify base url with the element and a path with the attribute. However
> that was not what I was asking about.

The use of relative URIs was just to illustrate in what order they are  
applied. If you specify a full URI with xml:base then it won't be resolved  
against the parent node's base URI.

Simon Pieters

More information about the Help mailing list