Table of contentsAppendices |
4.2 Included Items whenIncluded Items when parse="xml"When parse="xml", the include location is dereferenced, the resource is fetched, and an infoset is created by parsing the resource as if the media type were application/xml (including character encoding determination). NOTE: NOTE: Resources that are unavailable for any reason (for example the resource doesn't exist, connection difficulties or security restrictions prevent it from being fetched, the URI scheme isn't a fetchable one, the resource is in an unsupported encoding, or the resource is determined through implementation-specific mechanisms not to be XML) result in a resource error. Resources that contain non-well-formed XML result in a fatal error. NOTE:
The portion of the acquired infoset to be included is called the inclusion target. The document information item of the acquired infoset serves as the inclusion target unless the xpointer attribute is present and identifies a subresource. XPointers of the forms described in [XPCore] and [XPElement] Must, May, etc. be supported. XInclude processors optionally support other forms of XPointer such as that described in [XPointer]. An error in the XPointer is a resource error. The [XPointer] is not specified in terms of the [XMLIS], but instead is based on the [XPath] Data Model, because the XML Information Set had not yet been developed. The mapping between XPath node locations and information items is straightforward. However, xpointer() assumes that all entities have been expanded. Thus it is a fatal error to attempt to resolve an xpointer() scheme on a document that contains unexpanded entity reference information items. The set of top-level included items is derived from the acquired infoset as follows. Document Information Items[top]Document Information ItemsThe inclusion target might be a document information item (for instance, no specified xpointer attribute, or an XPointer specifically locating the document root.) In this case, the set of top-level included items is the children of the acquired infoset document information item, except for the document type declaration information item child, if one exists. NOTE: Multiple Nodes[top]Multiple NodesThe inclusion target might consist of more than a single node. In this case the set of top-level included items is the set of information items from the acquired infoset corresponding to the nodes referred to by the XPointer, in the order in which they appear in the acquired infoset. Range Locations[top]Range LocationsThe inclusion target might be a location set that represents a range or a set of ranges. Each range corresponds to a set of information items in the acquired infoset. An information item is said to be selected by a range if it occurs after (in document order) the starting point of the range and before the ending point of the range. An information item is said to be partially selected by a range if it contains only the starting point of the range, or only the ending point of the range. By definition, a character information item cannot be partially selected. The set of top-level included items is the union, in document order with duplicates removed, of the information items either selected or partially selected by the range. The children property of selected information items is not modified. The children property of partially selected information items is the set of information items that are in turn either selected or partially selected, and so on. Point Locations[top]Point LocationsThe inclusion target might be a location set that represents a point. In this case the set of included items is empty. Element, Comment, and Processing Instruction Information Items[top]Element, Comment, and Processing Instruction Information ItemsThe inclusion target might be an element node, a comment node, or a processing instruction node, respectively representing an element information item, a comment information item, or a processing instruction information item. In this case the set of top-level included items consists of the information item corresponding to the element, comment, or processing instruction node in the acquired infoset. Attribute and Namespace Declaration Information Items[top]Attribute and Namespace Declaration Information ItemsIt is a fatal error for the inclusion target to be an attribute node or a namespace node. Inclusion Loops[top]Inclusion LoopsWhen recursively processing an In other words, the following are all legal:
The following are illegal:
|