Stylus Studio XML Editor

Table of contents

Appendices

4.1 The Include Location

The Include Location

The value of the href attribute, after escaping according to [Escaping of ], is interpreted as either a URI reference or an IRI reference. The base URI for relative URIs or IRIs is the base URI of the xi:include element as specified in [XMLBase]. The URI or IRI resulting from resolution of the normalized value of the href attribute (or the empty string if no attribute appears) to absolute URI or IRI form is called the include location.

The absence of a value for the href attribute, either by the appearance of href="" or by the absence of the href attribute, represents a case which may be incompatible with certain implementation strategies. For instance, an XInclude processor might not have a textual representation of the source infoset to include as parse="text", or it may be unable to access another part of the document using parse="xml" and an xpointer because of streamability concerns. An implementation Must, May, etc. choose to treat any or all absences of a value for the href attribute as resource error. Implementations Must, May, etc. document the conditions under which such resource error occur.

Escaping of href attribute values[top]

Escaping of href attribute values

The href attribute value is converted to either a URI reference or an IRI reference, as appropriate to the implementation.

Work is currently in progress to produce an RFC defining Internationalized Resource Identifiers (IRIs). Since this work is not yet complete, in this section we define IRI references syntactically. We expect to issue an erratum replacing portions of this section with a reference to the RFC when it is published. For a more general definition and discussion of IRIs see [IRIdraft] (work in progress).

An IRI reference is a string that can be converted to a URI reference by escaping the following additional characters:

  • the Unicode plane 0 characters #xA0 - #xD7FF, #xF900-#xFDCF, #xFDF0-#xFFEF

  • the Unicode plane 1-14 characters #x10000-#x1FFFD ... #xE0000-#xEFFFD

To convert the value of the href attribute to an IRI reference, the following characters Must, May, etc. be escaped:

  • space #x20

    NOTE: 

    Authors are advised to avoid unescaped spaces, as XML Schema has identified them as an interoperability risk.

  • the delimiters < #x3C, > #x3E and " #x22

  • the unwise characters { #x7B, } #x7D, | #x7C, \ #x5C, ^ #x5E and ` #x60

These characters are escaped as follows:

  1. Each additional character is converted to UTF-8 [Unicode] as one or more bytes.

  2. The resulting bytes are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).

  3. The original character is replaced by the resulting character sequence.

To convert an IRI reference to a URI reference, the additional characters allowed in IRIs Must, May, etc. be escaped using the same method.

Using XInclude with Content Negotiation[top]

Using XInclude with Content Negotiation

The use of a mechanism like HTTP [RFC2616] content negotiation introduces an additional level of potential complexity into the use of XInclude. Developers who use XInclude in situations where content negotiation is likely or possible should be aware of the possibility that they will be including content that may differ structurally from the content they expected, even if that content is XML. For example, a single URI or IRI may variously return a raw XML representation of the resource, an XSL-FO [XSL-FO] representation, or an XHTML [XHTML] representation, as well as versions in different character encodings or languages.

Authors whose XInclude processing depends on the receipt of a particular vocabulary of XML should use the accept and accept-language attributes to increase the probability that the resource is provided in the expected format.