Table of contentsAppendices |
4.5 Creating the Result InfosetCreating the Result InfosetThe result infoset is a copy of the source infoset,
with each The information item for the It is a fatal error to attempt to replace an Some processors may not be able to represent an element's in-scope namespaces property if it does not include bindings for all the prefixes bound in its parent's in-scope namespaces. Such processors Must, May, etc. therefore include additional namespace bindings inherited from the include parent in the in-scope namespaces of the included items. The inclusion history of each top-level included items is recorded in the extension property
include history. The
include history property is
a list of element information items,
representing the The included items will all appear in the result infoset. This includes unexpanded entity reference information items if they are present. Intra-document references within In the following example, the second include always points to
the first <x xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="something.xml"/>
<xi:include xpointer="xmlns(xi=http://www.w3.org/2001/XInclude)xpointer(x/xi:include[1])"
parse="xml"/>
</x>
Unparsed Entities[top]Unparsed EntitiesAny unparsed entity information item appearing in the references property of an attribute on the included items or any descendant thereof is added to the unparsed entities property of the result infoset's document information item, if it is not a duplicate of an existing member. Duplicates do not appear in the result infoset. Unparsed entity items with the same name, system identifier, public identifier, declaration base URI, notation name, and notation are considered to be duplicate. An application Must, May, etc. also be able to detect that unparsed entities are duplicate through other means. For instance, the URI resulting from combining the system identifier and the declaration base URI is the same. It is a fatal error to include unparsed entity items with the same name, but which are not determined to be duplicates. Notations[top]NotationsAny notation information item appearing in the references property of an attribute in the included items or any descendant thereof is added to the notations property of the result infoset's document information item, if it is not a duplicate of an existing member. Likewise, any notation referenced by an unparsed entity added as described in [Unparsed Entities], is added unless it is a duplicate. Duplicates do not appear in the result infoset. Notation items with the same name, system identifier, public identifier, and declaration base URI are considered to be duplicate. An application Must, May, etc. also be able to detect that notations are duplicate through other means. For instance, the URI resulting from combining the system identifier and the declaration base URI is the same. It is a fatal error to include notation items with the same name, but which are not determined to be duplicates. references Property Fixup[top]references Property FixupDuring inclusion, an attribute information item whose attribute type property is IDREF or IDREFS has a references property with zero or more element values from the source or included infosets. These values Must, May, etc. be adjusted to correspond to element values that occur in the result infoset. During this process, XInclude also corrects inconsistencies between the references property and the attribute type property, which might arise in the following circumstances:
In resolving these inconsistencies, XInclude takes the attribute type property as definitive. In the result infoset, the value of the references property of an attribute information item whose attribute type property is IDREF or IDREFS is adjusted as follows: For each token in the normalized value property, the references property contains an element information item with the same properties as the element information item in the result infoset with an attribute with attribute type ID and normalized value equal to the token. The order of the elements in the references property is the same as the order of the tokens appearing in the normalize value. If for any of the token values, no element or more than one element is found, the references property has no value. Namespace Fixup[top]Namespace FixupThe in-scope namespaces property ensures that namespace scope is preserved through inclusion. However, after inclusion, the namespace attributes property might not provide the full list of namespace declarations necessary to interpret qualified names in attribute or element content in the result. It is therefore not recommended that XInclude processors expose namespace attributes in the result. If this is unavoidable, the implementation Must, May, etc. add attribute information items to the namespace attributes property in order to approximate the information conveyed by in-scope namespaces. Base URI Fixup[top]Base URI FixupThe base URI property of the acquired infoset is not changed as a result of merging the infoset, and remains unchanged after merging. Thus relative URI references in the included infoset resolve to the same URI despite being included into a document with a potentially different base URI in effect. xml:base attributes are added to the result infoset to indicate this fact. Each element information item in the top-level included items which has a different base URI than its include parent has an attribute information item added to its attributes property. This attribute has the following properties:
If an xml:base attribute information item is already present, it is replaced by the new attribute. Language Fixup[top]Language FixupWhile the An XInclude processor Must, May, etc. augment
the source infoset and the
acquired infoset by adding
the language property to each
element information item. The value of
this property is the normalized value
of the Each element information item in the top-level included items which has a different value of language than its include parent (taking case-insensitivity into account per [RFC3066]), or that has a value if its include parent is a document information item, has an attribute information item added to its attributes property. This attribute has the following properties:
If an xml:lang attribute information item is already present, it is replaced by the new attribute. NOTE: Properties Preserved by the Infoset[top]Properties Preserved by the InfosetAs an infoset transformation, XInclude operates on the logical structure of XML documents, not on their text serialization. All properties of an information item described in [XMLIS] other than those specifically modified by this specification are preserved during inclusion. The include history and language properties introduced in this specification is also preserved. Extension properties such as [XMLSchemas] Post Schema Validation Infoset (PSVI) properties are discarded by default. However, an XInclude processor Must, May, etc., at user option, preserve these properties in the resulting infoset if they are correct according to the specification describing the semantics of the extension properties. For instance, the PSVI validity property describes the conditions of ancestors and descendants. Modification of ancestors and descendants during the XInclude process can render the value of this property inaccurate. By default, XInclude strips this property, but by user option the property could be recalculated to obtain a semantically accurate value. Precisely how this is accomplished is outside the scope of this specification. |