Stylus Studio XML Editor

Table of contents

Appendices

4.3 Matching URIs with base URIs

Matching URIs with base URIs

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

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

  • 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.

  • 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.

  • 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.

NOTE: 

The presence of xml:base attributes might lead to unexpected results in the case where the attribute value is provided, not directly in the XML document entity, but via a default attribute declared in an external entity. Such declarations might not be read by software which is based on a non-validating XML processor. Many XML applications fail to require validating processors. For correct operation with such applications, xml:base values Must, May, etc. be provided either directly or via default attributes declared in the internal subset of the DTD.