XML BASE

The HTML BASE element is one construct which allows authors to explicitly specify a document's base URI for the purpose of resolving relative URIs in links to external images, applets, form-processing programs, style sheets, and so on.
The syntax consists of a single XML attribute named "xml:base".
The attribute xml:base may be inserted in XML documents to specify a base URI other than the base URI of the document or external entity.The set of characters allowed in xml:base attributes is the same as for XMLhe set of characters allowed in xml:base attributes is the same as for XML.
Relative URIs appearing in an XML document are always resolved relative to either an element, a document entity, or an external entity.
The base URI is the URI used to retrieve the document entity or external entity.
The base URI of an element is:

  1. the base URI specified by an xml:base attribute on the element, if one exists, otherwise

  2. the base URI of the element's parent element within the document or external entity, if one exists, otherwise

  3. the base URI of the document entity or external entity containing the element.

Matching URIs with base URIs :- The base URI corresponding to a given relative URI appearing in an XML document is determined as follows:

  1. The base URI for a URI reference appearing in text content is the base URI of the element containing the text.

  2. The base URI for a URI reference appearing in an xml:base attribute is the base URI of the parent element of the element bearing the xml:base attribute, if one exists within the document entity or external entity, otherwise the base URI of the document entity or external entity containing the element.

  3. The base URI for a URI reference appearing in any other attribute value, including default attribute values, is the base URI of the element bearing the attribute.

  4. The base URI for a URI reference appearing in the content of a processing instruction is the base URI of the parent element of the processing instruction, if one exists within the document entity or external entity, otherwise the base URI of the document entity or external entity containing the processing instruction.
    1. For details refer w3c