http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Charter
Release Info

Installation
Download
Bug-Reporting

FAQs
Samples
API JavaDoc

Features
Properties

XNI Manual
XML Schema
SAX
DOM
Limitations

Source Repository
User Mail Archive
Dev Mail Archive

Questions
 

Answers
 
How do I enable XInclude processing?
 

Applications using JAXP 1.3 can enable XInclude processing by setting XInclude awareness on the parser factory. The following demonstrates how to accomplish this with SAX:

import javax.xml.parsers.SAXParserFactory;
     
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setXIncludeAware(true);
...  

You can also enable XInclude processing by turning on the XInclude feature.


Why are xml:base attributes added, which make Schema validation fail?
 

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 disable base URI fixup and language fixup so that these attributes will not be added.


Does the XInclude processor recognize xml:base attributes?
 

Yes. The XInclude specification requires processors to use the base URI (as specified in the XML Base recommendation) to resolve relative IRIs to compute the include location. Support for XML Base was added to the XInclude implementation in Xerces-J 2.6.0.


Does the XInclude processor perform language fixup?
 

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


Does the XInclude processor support XPointer?
 

Yes. The XInclude processor supports the XPointer Framework and the XPointer element() Scheme. The XPointer xpointer() Scheme is currently not supported.


Are the values of the content negotiation attributes used in an HTTP request?
 

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 negotation when parse="xml" was added to the XInclude implementation in Xerces-J 2.7.0.


Will the XInclude processor process include elements from the 'http://www.w3.org/2003/XInclude' namespace?
 

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 is no longer recognized.




Copyright © 1999-2005 The Apache Software Foundation. All Rights Reserved.