XML Base markup

The xml:base attribute is reserved for the purpose of re-setting the base location for relative URLs (the 'xml' prefix is reserved in the Namespaces scheme for significant XML-enhancing schemes, such as this one). The value of this attribute is a URL that points to the new base location. When attached to the root element of an XML document, it takes effect throughout the entire document, applying to all relative URLs that the document contains.

xml:base attribute

In the following example, the Link attribute contains a relative URL reference to the document '1984.xml', which would normally be expected to be present in the same directory as the source document, but is now expected to be found in the 'Orwell' directory instead:

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.