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 | |
| protected XMLParserConfiguration | |
| protected final XMLResourceIdentifier | |
| protected 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 ArrayList | |
| protected String | |
| protected XIncludeHandler | |
| private int | |
| private boolean[] | |
| private boolean[] | |
| protected SecurityManager | |
| private boolean | |
| private boolean | |
| protected ParserConfigurationSettings | |
| private int[] | |
| protected SymbolTable | |
| private final ArrayList | |
| 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 | |
| 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 | |
| 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
The name of the element that this attribute
is associated with. elementName, String The name of the attribute. attributeName, String The attribute type. This value will be one of
the following: "CDATA", "ENTITY", "ENTITIES",
"ENUMERATION", "ID", "IDREF", "IDREFS",
"NMTOKEN", "NMTOKENS", or "NOTATION". type, String[] If the type has the value "ENUMERATION" or
"NOTATION", this array holds the allowed attribute
values; otherwise, this array is null. enumeration, String The attribute default type. This value will be
one of the following: "#FIXED", "#IMPLIED",
"#REQUIRED", or null. defaultType, XMLString The attribute default value, or null if no
default value is specified. defaultValue, XMLString The attribute default value with no normalization
performed, or null if no default value is specified. nonNormalizedDefaultValue, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | characters(XMLString
The content. text, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| 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
The text in the comment. text, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| protected void | |
| protected void | |
| private void | copyFeatures1(Enumeration<E> features, String featurePrefix, XMLComponentManager from, ParserConfigurationSettings to)
|
| private void | copyFeatures1(Enumeration<E> features, String featurePrefix, XMLComponentManager from, XMLParserConfiguration to)
|
| private XMLInputSource | |
| public void | doctypeDecl(String
The name of the root element. rootElement, String The public identifier if an external DTD or null
if the external DTD is specified using SYSTEM. publicId, String The system identifier if an external DTD, null
otherwise. systemId, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | elementDecl(String
The name of the element. name, String The element content model. contentModel, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | emptyElement(QName
The name of the element. element, XMLAttributes The element attributes. attributes, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | endAttlist(Augmentations
Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | endCDATA(Augmentations
Additional information that may include infoset augmentations augs)Implements org. |
| public void | endConditional(Augmentations
Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | endDocument(Augmentations
Additional information that may include infoset augmentations augs)Implements org. |
| public void | endDTD(Augmentations
Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | endElement(QName
The name of the element. element, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | endExternalSubset(Augmentations
Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | endGeneralEntity(String
The name of the entity. name, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | endParameterEntity(String
The name of the parameter entity. name, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| private String | |
| public void | externalEntityDecl(String
The name of the entity. Parameter entity names start
with '%', whereas the name of a general entity is just
the entity name. name, XMLResourceIdentifier An object containing all location information
pertinent to this external entity. identifier, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public String | |
| public XMLDocumentHandler | getDocumentHandler()
Implements org. |
| public XMLDocumentSource | getDocumentSource()
Implements org. |
| public XMLDTDHandler | getDTDHandler()
Implements org. |
| public XMLDTDSource | |
| public Boolean | getFeatureDefault(String
The feature identifier. featureId)Implements org. |
| 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 org. |
| public String[] | getRecognizedFeatures()
Implements org. |
| public String[] | getRecognizedProperties()
Implements org. |
| 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
The ignorable whitespace. text, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | ignoredCharacters(XMLString
The ignored text. text, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | internalEntityDecl(String
The name of the entity. Parameter entity names start with
'%', whereas the name of a general entity is just the
entity name. name, XMLString The value of the entity. text, XMLString The non-normalized value of the entity. This
value contains the same sequence of characters that was in
the internal entity declaration, without any entity
references expanded. nonNormalizedText, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| private boolean | |
| 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
The name of the notation. name, XMLResourceIdentifier An object containing all location information
pertinent to this notation. identifier, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| protected XMLAttributes | Returns: the processed XMLAttributesProcesses the XMLAttributes object of startElement() calls. |
| public void | processingInstruction(String
The target. target, XMLString The data or null if none specified. data, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| 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
The component manager. componentManager)Implements org. |
| 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 org. |
| public void | setDocumentSource(XMLDocumentSource source)
Implements org. |
| public void | setDTDHandler(XMLDTDHandler handler)
Implements org. |
| public void | |
| private void | |
| public void | setFeature(String
The feature identifier. featureId, boolean The state of the feature. state)Implements org. |
| protected void | |
| protected void | |
| public void | setProperty(String
The property identifier. propertyId, Object The value of the property. value)Implements org. |
| 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 | |
| protected void | |
| protected void | |
| public void | startAttlist(String
The name of the element that this attribute
list is associated with. elementName, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | startCDATA(Augmentations
Additional information that may include infoset augmentations augs)Implements org. |
| public void | startConditional(short
The type of the conditional section. This value will
either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE. type, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | startDocument(XMLLocator
The document locator, or null if the document
location cannot be reported during the parsing
of this document. However, it is strongly
recommended that a locator be supplied that can
at least report the system identifier of the
document. locator, String The auto-detected IANA encoding name of the entity
stream. This value will be null in those situations
where the entity encoding is not auto-detected (e.g.
internal entities or a document entity that is
parsed from a java.io.Reader). encoding, NamespaceContext The namespace context in effect at the
start of this document.
This object represents the current context.
Implementors of this class are responsible
for copying the namespace bindings from the
the current context (and its parent contexts)
if that information is important. namespaceContext, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | startDTD(XMLLocator
The document locator, or null if the document
location cannot be reported during the parsing of
the document DTD. However, it is strongly
recommended that a locator be supplied that can
at least report the base system identifier of the
DTD. locator, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | startElement(QName
The name of the element. element, XMLAttributes The element attributes. attributes, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | startExternalSubset(XMLResourceIdentifier
The resource identifier. identifier, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | startGeneralEntity(String
The name of the general entity. name, XMLResourceIdentifier The resource identifier. resId, String The auto-detected IANA encoding name of the entity
stream. This value will be null in those situations
where the entity encoding is not auto-detected (e.g.
internal entities or a document entity that is
parsed from a java.io.Reader). encoding, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | startParameterEntity(String
The name of the parameter entity. name, XMLResourceIdentifier The resource identifier. identifier, String The auto-detected IANA encoding name of the entity
stream. This value will be null in those situations
where the entity encoding is not auto-detected (e.g.
internal parameter entities). encoding, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | textDecl(String
The XML version, or null if not specified. version, String The IANA encoding name of the entity. encoding, Augmentations Additional information that may include infoset augmentations augs)Implements org. |
| public void | unparsedEntityDecl(String
The name of the entity. name, XMLResourceIdentifier An object containing all location information
pertinent to this unparsed entity declaration. identifier, String The name of the notation. notation, Augmentations Additional information that may include infoset
augmentations. augmentations)Implements org. |
| public void | xmlDecl(String
The XML version. version, String The IANA encoding name of the document, or null if
not specified. encoding, String The standalone value, or null if not specified. standalone, Augmentations Additional information that may include infoset augmentations augs)Implements org. |