xml:base is an XML attribute. When set on an element, it overrides the base URI of that element and its child nodes in the DOM.
The base URI is used to resolve relative URIs when needed. In XML context, XLink and XInclude rely on this. For example in the snippet below the URI
xlink:href="pick1.xml" points to is affected by the
xml:base attribute on the parent
<!-- ... --> <olist xml:base="/hotpicks/"> <item> <link xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</link> </item> </olist> <!-- ... -->
The algorithm used to compute the base URI is described in the XML base specification (see below).
xml:base and HTML
<base> element in HTML can be used to override the base URI of the document.
HTML doesn't have a syntax to specify a base URIs for a document subtree, although it's possible to use
xml:base in XHTML documents or even
setAttributeNS("http://www.w3.org/XML/1998/namespace", "base", baseURI) in text/html documents with supporting browsers (like Gecko). In this case the value of
Node.baseURI may be affected by both the document's base URI (modified with
<base>) and the