XIncludeHandler
in the pipeline
* before the schema validator, or as the last component in the pipeline if there is
* no schema validator. Using this pipeline will enable processing according to the
* XML Inclusions specification, to the conformance level described in
* XIncludeHandler
.
*
* @author Peter McCracken, IBM
* @see com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler
*/
public class XIncludeParserConfiguration extends XML11Configuration {
private XIncludeHandler fXIncludeHandler;
/** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
/** Feature identifier: fixup base URIs. */
protected static final String XINCLUDE_FIXUP_BASE_URIS =
Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;
/** Feature identifier: fixup language. */
protected static final String XINCLUDE_FIXUP_LANGUAGE =
Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;
/** Property identifier: error reporter. */
protected static final String XINCLUDE_HANDLER =
Constants.XERCES_PROPERTY_PREFIX + Constants.XINCLUDE_HANDLER_PROPERTY;
/** Property identifier: error reporter. */
protected static final String NAMESPACE_CONTEXT =
Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
/** Default constructor. */
public XIncludeParserConfiguration() {
this(null, null, null);
} //
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
*/
public XIncludeParserConfiguration(
SymbolTable symbolTable,
XMLGrammarPool grammarPool) {
this(symbolTable, grammarPool, null);
} //
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
* @param parentSettings The parent settings.
*/
public XIncludeParserConfiguration(
SymbolTable symbolTable,
XMLGrammarPool grammarPool,
XMLComponentManager parentSettings) {
super(symbolTable, grammarPool, parentSettings);
fXIncludeHandler = new XIncludeHandler();
addCommonComponent(fXIncludeHandler);
final String[] recognizedFeatures = {
ALLOW_UE_AND_NOTATION_EVENTS,
XINCLUDE_FIXUP_BASE_URIS,
XINCLUDE_FIXUP_LANGUAGE
};
addRecognizedFeatures(recognizedFeatures);
// add default recognized properties
final String[] recognizedProperties =
{ XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
addRecognizedProperties(recognizedProperties);
setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
} //