This is a pipeline component which performs XInclude handling, according to the W3C specification for XML Inclusions.
This component analyzes each event in the pipeline, looking for <include>
elements. An <include> element is one which has a namespace of
http://www.w3.org/2001/XInclude and a localname of include.
When it finds an <include> element, it attempts to include the file specified
in the href attribute of the element. If inclusion succeeds, all
children of the <include> element are ignored (with the exception of
checking for invalid children as outlined in the specification). If the inclusion
fails, the <fallback> child of the <include> element is processed.
See the XInclude specification for more information on how XInclude is to be used.
This component requires the following features and properties from the component manager that uses it:
NamespaceContext used in the pipeline is required
to be an instance of XIncludeNamespaceSupport.
Currently, this implementation has only partial support for the XInclude specification. Specifically, it is missing support for XPointer document fragments. Thus, only whole documents can be included using this component in the pipeline.
XIncludeNamespaceSupport
| Modifier and Type | Class and Description |
|---|---|
| protected static class | |
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected static final String | ALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order. |
| protected static final String | BUFFER_SIZE
property identifier: buffer size. |
| public static final String | CURRENT_BASE_URI
The identifier for the Augmentation that contains the current base URI |
| protected static final String | DYNAMIC_VALIDATION
Feature identifier: dynamic validation. |
| protected static final String | ENTITY_RESOLVER
Property identifier: entity resolver. |
| protected static final String | ERROR_REPORTER
Property identifier: error reporter. |
| protected final Stack | |
| protected final IntStack | |
| protected int | |
| pack-priv CatalogFeatures | |
| private String | |
| pack-priv CatalogResolver | |
| protected XMLParserConfiguration | |
| protected final XMLResourceIdentifier | |
| protected String | |
| private String | |
| private int | |
| protected XMLLocator | |
| protected XMLDocumentHandler | |
| protected XMLDocumentSource | |
| protected XMLDTDHandler | |
| protected XMLDTDSource | |
| private static final Boolean[] | FEATURE_DEFAULTS
Feature defaults. |
| protected XMLEntityResolver | |
| protected XMLErrorReporter | |
| protected final Stack | |
| private boolean | |
| private boolean | |
| pack-priv boolean | |
| protected String | |
| private boolean | |
| private boolean | |
| protected final IntStack | |
| protected final Stack | |
| protected final Stack | |
| protected XIncludeNamespaceSupport | |
| private boolean | |
| private final List | |
| protected String | |
| protected XIncludeHandler | |
| private String | |
| private String | |
| private int | |
| private boolean[] | |
| private boolean[] | |
| protected XMLSecurityManager | |
| protected XMLSecurityPropertyManager | |
| private boolean | |
| private boolean | |
| protected ParserConfigurationSettings | |
| private int[] | |
| protected SymbolTable | |
| private final List | |
| private boolean | fUseCatalog
indicate whether Catalog should be used for resolving external resources |
| protected XIncludeTextReader | |
| protected XIncludeTextReader | |
| protected XMLParserConfiguration | |
| protected XMLLocatorWrapper | |
| protected XIncludeMessageFormatter | |
| protected XMLParserConfiguration | |
| protected XPointerProcessor | |
| private static final char[] | |
| private static final char[] | |
| private static final char[] | |
| private static final boolean[] | |
| public static final String | |
| public static final String | |
| private static final int | |
| protected static final String | JAXP_SCHEMA_LANGUAGE
Property identifier: JAXP schema language. |
| private static final QName | |
| protected static final String | |
| private static final Object[] | PROPERTY_DEFAULTS
Property defaults. |
| private static final String[] | RECOGNIZED_FEATURES
Recognized features. |
| private static final String[] | RECOGNIZED_PROPERTIES
Recognized properties. |
| protected static final String | SCHEMA_VALIDATION
Feature identifier: schema validation. |
| protected static final String | SECURITY_MANAGER
property identifier: security manager. |
| private static final int | |
| private static final int | |
| private static final int | |
| protected static final String | SYMBOL_TABLE
Property identifier: symbol table. |
| protected static final String | VALIDATION
Feature identifier: validation. |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| private static final String | |
| public static final String | |
| protected static final String | XINCLUDE_FIXUP_BASE_URIS
Feature identifier: fixup base URIs. |
| protected static final String | XINCLUDE_FIXUP_LANGUAGE
Feature identifier: fixup language. |
| public static final String | |
| public static final String | |
| private static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| private static final QName | |
| private static final QName | |
| protected static final String | XML_SECURITY_PROPERTY_MANAGER
property identifier: XML security property manager. |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addNotation(String
the name of the notation name, XMLResourceIdentifier the location of the notation identifier, Augmentations any Augmentations that were on the original notation declaration augmentations)Caches a notation. |
| protected void | addUnparsedEntity(String
the name of the unparsed entity name, XMLResourceIdentifier the location of the unparsed entity identifier, String notation, Augmentations any Augmentations that were on the original unparsed entity declaration augmentations)Caches an unparsed entity. |
| public void | attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations)
Implements com. An attribute declaration. |
| public void | characters(XMLString text, Augmentations augs)
Implements com. Character content. |
| protected void | checkAndSendNotation(XIncludeHandler.
the Notation to check for conflicts notThe purpose of this method is to check if a Notation conflicts with a previously declared notation in the current pipeline stack. |
| protected void | checkAndSendUnparsedEntity(XIncludeHandler.
the UnparsedEntity to check for conflicts entThe purpose of this method is to check if an UnparsedEntity conflicts with a previously declared entity in the current pipeline stack. |
| private void | |
| protected void | checkNotation(String
the name of the Notation to check notName)Checks if a Notation with the given name was declared in the DTD of the document for the current pipeline. |
| protected void | checkUnparsedEntity(String
the name of the UnparsedEntity to check entName)Checks if an UnparsedEntity with the given name was declared in the DTD of the document for the current pipeline. |
| private void | checkWhitespace(XMLString
the text to check value)Checks whether the string only contains white space characters. |
| public void | comment(XMLString text, Augmentations augs)
Implements com. A comment. |
| protected void | |
| protected void | |
| private void | copyFeatures1(Enumeration<Object> features, String featurePrefix, XMLComponentManager from, ParserConfigurationSettings to)
|
| private void | copyFeatures1(Enumeration<Object> features, String featurePrefix, XMLComponentManager from, XMLParserConfiguration to)
|
| private XMLInputSource | |
| public void | doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
Implements com. Notifies of the presence of the DOCTYPE line in the document. |
| public void | elementDecl(String name, String contentModel, Augmentations augmentations)
Implements com. An element declaration. |
| public void | emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
Implements com. An empty element. |
| public void | endAttlist(Augmentations augmentations)
Implements com. The end of an attribute list. |
| public void | endCDATA(Augmentations augs)
Implements com. The end of a CDATA section. |
| public void | endConditional(Augmentations augmentations)
Implements com. The end of a conditional section. |
| public void | endDocument(Augmentations augs)
Implements com. The end of the document. |
| public void | endDTD(Augmentations augmentations)
Implements com. The end of the DTD. |
| public void | endElement(QName element, Augmentations augs)
Implements com. The end of an element. |
| public void | endExternalSubset(Augmentations augmentations)
Implements com. The end of the DTD external subset. |
| public void | endGeneralEntity(String name, Augmentations augs)
Implements com. This method notifies the end of a general entity. |
| public void | endParameterEntity(String name, Augmentations augmentations)
Implements com. This method notifies the end of a parameter entity. |
| private String | |
| public void | externalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
Implements com. An external entity declaration. |
| public String | |
| public XMLDocumentHandler | getDocumentHandler()
Implements com. Returns the document handler |
| public XMLDocumentSource | getDocumentSource()
Implements com. Returns the document source. |
| public XMLDTDHandler | getDTDHandler()
Implements com. Returns the DTD handler. |
| public XMLDTDSource | |
| public Boolean | getFeatureDefault(String
The feature identifier. featureId)Implements com. Returns the default state for a feature, or null if this component does not want to report a default value for this feature. |
| private String | Returns: the base URI of the include parent.Returns the [base URI] of the include parent. |
| private int | Returns: the depth of the top level include elementReturns the depth of the include parent. |
| private String | Returns: the language property of the include parent.Returns the [language] of the include parent. |
| public String | |
| public Object | getPropertyDefault(String
The property identifier. propertyId)Implements com. Returns the default state for a property, or null if this component does not want to report a default value for this property. |
| public String[] | getRecognizedFeatures()
Implements com. Returns a list of feature identifiers that are recognized by this component. |
| public String[] | getRecognizedProperties()
Implements com. Returns a list of property identifiers that are recognized by this component. |
| protected String | Returns: the relative URIReturns a URI, relative to the include parent's base URI, of the current [base URI]. |
| public String | Returns: a relative URI to convert the base URI at the given depth to the current base URIthe depth at which to start creating the relative URI depth)Returns a relative URI, which when resolved against the base URI at the specified depth, will create the current base URI. |
| private int | |
| private boolean | |
| protected boolean | getSawFallback(int depth)
Returns whether an <fallback> was encountered at the specified depth, as an ancestor of the current element, or as a sibling of an ancestor of the current element. |
| protected boolean | Returns: true if an include was seen at the given depth, false otherwiseReturn whether an <include> was encountered at the specified depth, as an ancestor of the current item. |
| protected int | |
| protected int | |
| protected void | |
| protected boolean | |
| protected boolean | Returns: true if the element has the namespace "http://www.w3.org/2001/XInclude"the element to check element)Returns true if the element has the namespace "http://www.w3.org/2001/XInclude" |
| public void | ignorableWhitespace(XMLString text, Augmentations augs)
Implements com. Ignorable whitespace. |
| public void | ignoredCharacters(XMLString text, Augmentations augmentations)
Implements com. Characters within an IGNORE conditional section. |
| public void | internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations)
Implements com. An internal entity declaration. |
| protected boolean | Returns: true if the element is an <fallback; elementthe element to check element)Checks if the element is an <fallback> element. |
| protected boolean | Returns: true if the element is an <include> elementthe element to check element)Checks if the element is an <include> element. |
| protected boolean | |
| protected boolean | Returns: true if the current element is a top level included itemReturns true if the current element is a top level included item. |
| protected boolean | |
| protected boolean | |
| private boolean | Returns: true if the given string
would be valid in an HTTP headerstring to check value)Returns |
| protected Augmentations | Returns: the modified Augmentationsthe Augmentations to modify. augs)Modify the augmentations. |
| protected Augmentations | Returns: the modified Augmentationsthe Augmentations to modify. augs, boolean whether to force modification force)Modify the augmentations. |
| public void | notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
Implements com. A notation declaration |
| protected XMLAttributes | Returns: the processed XMLAttributesProcesses the XMLAttributes object of startElement() calls. |
| public void | processingInstruction(String target, XMLString data, Augmentations augs)
Implements com. A processing instruction. |
| protected void | processXMLBaseAttributes(XMLAttributes attributes)
Search for a xml:base attribute, and if one is found, put the new base URI into effect. |
| protected void | processXMLLangAttributes(XMLAttributes attributes)
Search for a xml:lang attribute, and if one is found, put the new [language] into effect. |
| private void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | reset(XMLComponentManager componentManager)
Implements com. Resets the component. |
| protected void | |
| public String | |
| protected boolean | Returns: true if the [base URIs] are the same stringReturns true if the current [base URI] is the same as the [base URI] that was in effect on the include parent. |
| protected boolean | Returns: true if the [language] properties have the same value taking case-insensitivity into account as per [RFC 3066].Returns true if the current [language] is equivalent to the [language] that was in effect on the include parent, taking case-insensitivity into account as per [RFC 3066]. |
| protected void | |
| protected void | saveLanguage(String
the language to push onto the stack. language)Saves the given language on the top of the stack. |
| private int | |
| private int | |
| protected boolean | Returns: true if the source has already been includedthe system id to check for inclusion includedSysId)Checks if the file indicated by the given system id has already been included in the current stack. |
| public void | setDocumentHandler(XMLDocumentHandler handler)
Implements com. Sets the document handler. |
| public void | setDocumentSource(XMLDocumentSource source)
Implements com. Sets the document source. |
| public void | setDTDHandler(XMLDTDHandler handler)
Implements com. Sets the DTD handler. |
| public void | |
| private void | |
| public void | setFeature(String
The feature identifier. featureId, boolean The state of the feature. state)Implements com. Sets the state of a feature. |
| protected void | |
| protected void | |
| public void | setProperty(String
The property identifier. propertyId, Object The value of the property. value)Implements com. Sets the value of a property. |
| private void | |
| protected void | setSawFallback(int depth, boolean val)
Records that an <fallback> was encountered at the specified depth, as an ancestor of the current element, or as a sibling of an ancestor of the current element. |
| protected void | setSawInclude(int depth, boolean val)
Records that an <include> was encountered at the specified depth, as an ancestor of the current item. |
| protected void | |
| private void | |
| protected void | |
| public void | startAttlist(String elementName, Augmentations augmentations)
Implements com. The start of an attribute list. |
| public void | startCDATA(Augmentations augs)
Implements com. The start of a CDATA section. |
| public void | startConditional(short type, Augmentations augmentations)
Implements com. The start of a conditional section. |
| public void | startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs)
Implements com. Event sent at the start of the document. |
| public void | startDTD(XMLLocator locator, Augmentations augmentations)
Implements com. The start of the DTD. |
| public void | startElement(QName element, XMLAttributes attributes, Augmentations augs)
Implements com. The start of an element. |
| public void | startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
Implements com. The start of the DTD external subset. |
| public void | startGeneralEntity(String name, XMLResourceIdentifier resId, String encoding, Augmentations augs)
Implements com. This method notifies the start of a general entity. |
| public void | startParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations)
Implements com. This method notifies of the start of a parameter entity. |
| public void | textDecl(String version, String encoding, Augmentations augs)
Implements com. Notifies of the presence of a TextDecl line in an entity. |
| public void | unparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations)
Implements com. An unparsed entity declaration. |
| public void | xmlDecl(String version, String encoding, String standalone, Augmentations augs)
Implements com. Notifies of the presence of an XMLDecl line in the document. |