Using XInclude (original) (raw)
| | UsageXInclude and validationxml:base attributes and XML Schema validationXML Base SupportLanguage FixupReferences Property FixupDocument FragmentsXPointer and IDsContent NegotiationThe Namespace: 'http://www.w3.org/2003/XInclude' | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | Applications using JAXP 1.3 (and above) can enable XInclude processing by setting XInclude awareness on the parser factory. The following demonstrates how to accomplish this with SAX: You can also enable XInclude processing by turning on the XInclude feature. If the validation feature is turned on then DTD validation will be performed on each source document (to the XInclude processor) against their respective DTDs. If both the validation feature and the schema validation feature are turned on then schema validation will be performed on the result infoset generated by the XInclude processor. DTD validation will be performed on each source document which contains a DTD. No DTD validation errors will be reported for source documents which have no DTD. According to the specification for XInclude, processors must add an xml:base attribute to elements included from locations with a different base URI. Without these attributes, the resulting infoset information would be incorrect. Unfortunately, these attributes make XInclude processing not transparent to Schema validation. One solution to this is to modify your schema to allow xml:base attributes to appear on elements that might be included from different base URIs. There is a similar problem with xml:lang attributes that are added as a result of language fixup. If the addition of xml:base and/or xml:lang is undesired by your application, you can disablebase URI fixup and language fixup so that these attributes will not be added. Yes. The XInclude specification requires processors to use the base URI (as specified in the XML Base recommendation) to resolve relative IRIs to compute theinclude location. Support for XML Base was added to the XInclude implementation in Xerces-J 2.6.0. Yes. The XInclude processor will preserve language information on a top-level included element by adding an xml:lang attribute if its include parent has a different [language] property. Support for language fixup was added to the XInclude implementation in Xerces-J 2.7.0. Section 4.5.3 of the XInclude 1.0 W3C Recommendation describes fixup of the [references] property of an attribute information item. For IDREF/IDREFS the property contains an ordered list of element information items. Xerces provides no mechanism for accessing this property nor does it keep an internal representation. It should be noted that neither the SAX or DOM APIs have native support for the [references] property. For Xerces, references property fixup is a no-op. Yes, the values of the accept and accept-language attributes from an include element are included as request properties in an HTTP request. Support for content negotiation when parse="xml" was added to the XInclude implementation in Xerces-J 2.7.0. No. The namespace for XInclude was changed back to http://www.w3.org/2001/XInclude in the Candidate Recommendation (April 2004). The http://www.w3.org/2003/XInclude namespace is no longer recognized. | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |