org.apache.xerces.xinclude

Class XIncludeHandler

public class XIncludeHandler extends Object implements XMLComponent, XMLDocumentFilter, XMLDTDFilter

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:

Optional property: Furthermore, the 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.

Version: $Id: XIncludeHandler.java,v 1.56 2005/07/25 18:04:26 mrglavas Exp $

Author: Peter McCracken, IBM Michael Glavassevich, IBM

See Also: XIncludeNamespaceSupport

Nested Class Summary
protected static classXIncludeHandler.Notation
protected static classXIncludeHandler.UnparsedEntity
Field Summary
protected static StringALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order.
static StringBUFFER_SIZE
property identifier: buffer size.
static StringCURRENT_BASE_URI
The identifier for the Augmentation that contains the current base URI
protected static StringDYNAMIC_VALIDATION
Feature identifier: dynamic validation.
protected static StringENTITY_RESOLVER
Property identifier: entity resolver.
protected static StringERROR_REPORTER
Property identifier: error reporter.
protected StackfBaseURI
protected IntStackfBaseURIScope
protected intfBufferSize
protected XMLParserConfigurationfChildConfig
protected XMLResourceIdentifierfCurrentBaseURI
protected StringfCurrentLanguage
protected XMLLocatorfDocLocation
protected XMLDocumentHandlerfDocumentHandler
protected XMLDocumentSourcefDocumentSource
protected XMLDTDHandlerfDTDHandler
protected XMLDTDSourcefDTDSource
protected XMLEntityResolverfEntityResolver
protected XMLErrorReporterfErrorReporter
protected StackfExpandedSystemID
protected IntStackfLanguageScope
protected StackfLanguageStack
protected StackfLiteralSystemID
protected XIncludeNamespaceSupportfNamespaceContext
protected StringfParentRelativeURI
protected XIncludeHandlerfParentXIncludeHandler
protected SecurityManagerfSecurityManager
protected ParserConfigurationSettingsfSettings
protected SymbolTablefSymbolTable
protected XIncludeTextReaderfXInclude10TextReader
protected XIncludeTextReaderfXInclude11TextReader
protected XMLParserConfigurationfXIncludeChildConfig
protected XIncludeMessageFormatterfXIncludeMessageFormatter
protected XMLParserConfigurationfXPointerChildConfig
protected XPointerProcessorfXPtrProcessor
static StringHTTP_ACCEPT
static StringHTTP_ACCEPT_LANGUAGE
static QNameNEW_NS_ATTR_QNAME
protected static StringPARSER_SETTINGS
protected static StringSCHEMA_VALIDATION
Feature identifier: schema validation.
protected static StringSECURITY_MANAGER
property identifier: security manager.
protected static StringSYMBOL_TABLE
Property identifier: symbol table.
protected static StringVALIDATION
Feature identifier: validation.
static StringXINCLUDE_ATTR_ACCEPT
static StringXINCLUDE_ATTR_ACCEPT_LANGUAGE
static StringXINCLUDE_ATTR_ENCODING
static StringXINCLUDE_ATTR_HREF
static StringXINCLUDE_ATTR_PARSE
static StringXINCLUDE_BASE
static StringXINCLUDE_DEFAULT_CONFIGURATION
static StringXINCLUDE_FALLBACK
protected static StringXINCLUDE_FIXUP_BASE_URIS
Feature identifier: fixup base URIs.
protected static StringXINCLUDE_FIXUP_LANGUAGE
Feature identifier: fixup language.
static StringXINCLUDE_INCLUDE
static StringXINCLUDE_INCLUDED
static StringXINCLUDE_LANG
static StringXINCLUDE_NS_URI
static StringXINCLUDE_PARSE_TEXT
static StringXINCLUDE_PARSE_XML
static QNameXML_BASE_QNAME
static QNameXML_LANG_QNAME
static StringXPOINTER
Constructor Summary
XIncludeHandler()
Method Summary
protected voidaddNotation(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
Caches a notation.
protected voidaddUnparsedEntity(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations)
Caches an unparsed entity.
voidattributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations)
voidcharacters(XMLString text, Augmentations augs)
protected voidcheckAndSendNotation(XIncludeHandler.Notation not)
The purpose of this method is to check if a Notation conflicts with a previously declared notation in the current pipeline stack.
protected voidcheckAndSendUnparsedEntity(XIncludeHandler.UnparsedEntity ent)
The purpose of this method is to check if an UnparsedEntity conflicts with a previously declared entity in the current pipeline stack.
protected voidcheckNotation(String notName)
Checks if a Notation with the given name was declared in the DTD of the document for the current pipeline.
protected voidcheckUnparsedEntity(String entName)
Checks if an UnparsedEntity with the given name was declared in the DTD of the document for the current pipeline.
voidcomment(XMLString text, Augmentations augs)
protected voidcopyFeatures(XMLComponentManager from, ParserConfigurationSettings to)
protected voidcopyFeatures(XMLComponentManager from, XMLParserConfiguration to)
voiddoctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
voidelementDecl(String name, String contentModel, Augmentations augmentations)
voidemptyElement(QName element, XMLAttributes attributes, Augmentations augs)
voidendAttlist(Augmentations augmentations)
voidendCDATA(Augmentations augs)
voidendConditional(Augmentations augmentations)
voidendDocument(Augmentations augs)
voidendDTD(Augmentations augmentations)
voidendElement(QName element, Augmentations augs)
voidendExternalSubset(Augmentations augmentations)
voidendGeneralEntity(String name, Augmentations augs)
voidendParameterEntity(String name, Augmentations augmentations)
voidexternalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
StringgetBaseURI(int depth)
Gets the base URI that was in use at that depth
XMLDocumentHandlergetDocumentHandler()
XMLDocumentSourcegetDocumentSource()
XMLDTDHandlergetDTDHandler()
XMLDTDSourcegetDTDSource()
BooleangetFeatureDefault(String featureId)
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
StringgetLanguage(int depth)
Gets the language that was in use at that depth.
ObjectgetPropertyDefault(String propertyId)
Returns the default state for a property, or null if this component does not want to report a default value for this property.
String[]getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this component.
String[]getRecognizedProperties()
Returns a list of property identifiers that are recognized by this component.
protected StringgetRelativeBaseURI()
Returns a URI, relative to the include parent's base URI, of the current [base URI].
StringgetRelativeURI(int depth)
Returns a relative URI, which when resolved against the base URI at the specified depth, will create the current base URI.
protected booleangetSawFallback(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 booleangetSawInclude(int depth)
Return whether an <include> was encountered at the specified depth, as an ancestor of the current item.
protected intgetState(int depth)
protected intgetState()
protected voidhandleFallbackElement()
protected booleanhandleIncludeElement(XMLAttributes attributes)
protected booleanhasXIncludeNamespace(QName element)
Returns true if the element has the namespace "http://www.w3.org/2001/XInclude"
voidignorableWhitespace(XMLString text, Augmentations augs)
voidignoredCharacters(XMLString text, Augmentations augmentations)
voidinternalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations)
protected booleanisFallbackElement(QName element)
Checks if the element is an <fallback> element.
protected booleanisIncludeElement(QName element)
Checks if the element is an <include> element.
protected booleanisRootDocument()
protected booleanisTopLevelIncludedItem()
Returns true if the current element is a top level included item.
protected booleanisTopLevelIncludedItemViaFallback()
protected booleanisTopLevelIncludedItemViaInclude()
protected AugmentationsmodifyAugmentations(Augmentations augs)
Modify the augmentations.
protected AugmentationsmodifyAugmentations(Augmentations augs, boolean force)
Modify the augmentations.
voidnotationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
protected XMLAttributesprocessAttributes(XMLAttributes attributes)
Processes the XMLAttributes object of startElement() calls.
voidprocessingInstruction(String target, XMLString data, Augmentations augs)
protected voidprocessXMLBaseAttributes(XMLAttributes attributes)
Search for a xml:base attribute, and if one is found, put the new base URI into effect.
protected voidprocessXMLLangAttributes(XMLAttributes attributes)
Search for a xml:lang attribute, and if one is found, put the new [language] into effect.
protected voidreportFatalError(String key)
protected voidreportFatalError(String key, Object[] args)
protected voidreportResourceError(String key)
protected voidreportResourceError(String key, Object[] args)
voidreset(XMLComponentManager componentManager)
protected voidrestoreBaseURI()
Discards the URIs at the top of the stack, and restores the ones beneath it.
StringrestoreLanguage()
Discards the language at the top of the stack, and returns the one beneath it.
protected booleansameBaseURIAsIncludeParent()
Returns true if the current [base URI] is the same as the [base URI] that was in effect on the include parent.
protected booleansameLanguageAsIncludeParent()
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 voidsaveBaseURI()
Saves the current base URI to the top of the stack.
protected voidsaveLanguage(String language)
Saves the given language on the top of the stack.
protected booleansearchForRecursiveIncludes(XMLLocator includedSource)
Checks if the file indicated by the given XMLLocator has already been included in the current stack.
voidsetDocumentHandler(XMLDocumentHandler handler)
voidsetDocumentSource(XMLDocumentSource source)
voidsetDTDHandler(XMLDTDHandler handler)
voidsetDTDSource(XMLDTDSource source)
voidsetFeature(String featureId, boolean state)
Sets the state of a feature.
protected voidsetParent(XIncludeHandler parent)
Set the parent of this XIncludeHandler in the tree
voidsetProperty(String propertyId, Object value)
Sets the value of a property.
protected voidsetSawFallback(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 voidsetSawInclude(int depth, boolean val)
Records that an <include> was encountered at the specified depth, as an ancestor of the current item.
protected voidsetState(int state)
voidstartAttlist(String elementName, Augmentations augmentations)
voidstartCDATA(Augmentations augs)
voidstartConditional(short type, Augmentations augmentations)
voidstartDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs)
Event sent at the start of the document.
voidstartDTD(XMLLocator locator, Augmentations augmentations)
voidstartElement(QName element, XMLAttributes attributes, Augmentations augs)
voidstartExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
voidstartGeneralEntity(String name, XMLResourceIdentifier resId, String encoding, Augmentations augs)
voidstartParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations)
voidtextDecl(String version, String encoding, Augmentations augs)
voidunparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations)
voidxmlDecl(String version, String encoding, String standalone, Augmentations augs)

Field Detail

ALLOW_UE_AND_NOTATION_EVENTS

protected static final String ALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order.

BUFFER_SIZE

public static final String BUFFER_SIZE
property identifier: buffer size.

CURRENT_BASE_URI

public static final String CURRENT_BASE_URI
The identifier for the Augmentation that contains the current base URI

DYNAMIC_VALIDATION

protected static final String DYNAMIC_VALIDATION
Feature identifier: dynamic validation.

ENTITY_RESOLVER

protected static final String ENTITY_RESOLVER
Property identifier: entity resolver.

ERROR_REPORTER

protected static final String ERROR_REPORTER
Property identifier: error reporter.

fBaseURI

protected Stack fBaseURI

fBaseURIScope

protected IntStack fBaseURIScope

fBufferSize

protected int fBufferSize

fChildConfig

protected XMLParserConfiguration fChildConfig

fCurrentBaseURI

protected XMLResourceIdentifier fCurrentBaseURI

fCurrentLanguage

protected String fCurrentLanguage

fDocLocation

protected XMLLocator fDocLocation

fDocumentHandler

protected XMLDocumentHandler fDocumentHandler

fDocumentSource

protected XMLDocumentSource fDocumentSource

fDTDHandler

protected XMLDTDHandler fDTDHandler

fDTDSource

protected XMLDTDSource fDTDSource

fEntityResolver

protected XMLEntityResolver fEntityResolver

fErrorReporter

protected XMLErrorReporter fErrorReporter

fExpandedSystemID

protected Stack fExpandedSystemID

fLanguageScope

protected IntStack fLanguageScope

fLanguageStack

protected Stack fLanguageStack

fLiteralSystemID

protected Stack fLiteralSystemID

fNamespaceContext

protected XIncludeNamespaceSupport fNamespaceContext

fParentRelativeURI

protected String fParentRelativeURI

fParentXIncludeHandler

protected XIncludeHandler fParentXIncludeHandler

fSecurityManager

protected SecurityManager fSecurityManager

fSettings

protected ParserConfigurationSettings fSettings

fSymbolTable

protected SymbolTable fSymbolTable

fXInclude10TextReader

protected XIncludeTextReader fXInclude10TextReader

fXInclude11TextReader

protected XIncludeTextReader fXInclude11TextReader

fXIncludeChildConfig

protected XMLParserConfiguration fXIncludeChildConfig

fXIncludeMessageFormatter

protected XIncludeMessageFormatter fXIncludeMessageFormatter

fXPointerChildConfig

protected XMLParserConfiguration fXPointerChildConfig

fXPtrProcessor

protected XPointerProcessor fXPtrProcessor

HTTP_ACCEPT

public static final String HTTP_ACCEPT

HTTP_ACCEPT_LANGUAGE

public static final String HTTP_ACCEPT_LANGUAGE

NEW_NS_ATTR_QNAME

public static final QName NEW_NS_ATTR_QNAME

PARSER_SETTINGS

protected static final String PARSER_SETTINGS

SCHEMA_VALIDATION

protected static final String SCHEMA_VALIDATION
Feature identifier: schema validation.

SECURITY_MANAGER

protected static final String SECURITY_MANAGER
property identifier: security manager.

SYMBOL_TABLE

protected static final String SYMBOL_TABLE
Property identifier: symbol table.

VALIDATION

protected static final String VALIDATION
Feature identifier: validation.

XINCLUDE_ATTR_ACCEPT

public static final String XINCLUDE_ATTR_ACCEPT

XINCLUDE_ATTR_ACCEPT_LANGUAGE

public static final String XINCLUDE_ATTR_ACCEPT_LANGUAGE

XINCLUDE_ATTR_ENCODING

public static final String XINCLUDE_ATTR_ENCODING

XINCLUDE_ATTR_HREF

public static final String XINCLUDE_ATTR_HREF

XINCLUDE_ATTR_PARSE

public static final String XINCLUDE_ATTR_PARSE

XINCLUDE_BASE

public static final String XINCLUDE_BASE

XINCLUDE_DEFAULT_CONFIGURATION

public static final String XINCLUDE_DEFAULT_CONFIGURATION

XINCLUDE_FALLBACK

public static final String XINCLUDE_FALLBACK

XINCLUDE_FIXUP_BASE_URIS

protected static final String XINCLUDE_FIXUP_BASE_URIS
Feature identifier: fixup base URIs.

XINCLUDE_FIXUP_LANGUAGE

protected static final String XINCLUDE_FIXUP_LANGUAGE
Feature identifier: fixup language.

XINCLUDE_INCLUDE

public static final String XINCLUDE_INCLUDE

XINCLUDE_INCLUDED

public static final String XINCLUDE_INCLUDED

XINCLUDE_LANG

public static final String XINCLUDE_LANG

XINCLUDE_NS_URI

public static final String XINCLUDE_NS_URI

XINCLUDE_PARSE_TEXT

public static final String XINCLUDE_PARSE_TEXT

XINCLUDE_PARSE_XML

public static final String XINCLUDE_PARSE_XML

XML_BASE_QNAME

public static final QName XML_BASE_QNAME

XML_LANG_QNAME

public static final QName XML_LANG_QNAME

XPOINTER

public static final String XPOINTER

Constructor Detail

XIncludeHandler

public XIncludeHandler()

Method Detail

addNotation

protected void addNotation(String name, XMLResourceIdentifier identifier, Augmentations augmentations)
Caches a notation.

Parameters: name the name of the notation identifier the location of the notation augmentations any Augmentations that were on the original notation declaration

addUnparsedEntity

protected void addUnparsedEntity(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations)
Caches an unparsed entity.

Parameters: name the name of the unparsed entity identifier the location of the unparsed entity augmentations any Augmentations that were on the original unparsed entity declaration

attributeDecl

public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations)

characters

public void characters(XMLString text, Augmentations augs)

checkAndSendNotation

protected void checkAndSendNotation(XIncludeHandler.Notation not)
The purpose of this method is to check if a Notation conflicts with a previously declared notation in the current pipeline stack. If there is no conflict, the Notation is sent by the root pipeline.

Parameters: not the Notation to check for conflicts

checkAndSendUnparsedEntity

protected void checkAndSendUnparsedEntity(XIncludeHandler.UnparsedEntity ent)
The purpose of this method is to check if an UnparsedEntity conflicts with a previously declared entity in the current pipeline stack. If there is no conflict, the UnparsedEntity is sent by the root pipeline.

Parameters: ent the UnparsedEntity to check for conflicts

checkNotation

protected void checkNotation(String notName)
Checks if a Notation with the given name was declared in the DTD of the document for the current pipeline. If so, that Notation is passed to the root pipeline to be checked for conflicts, and sent to the root DTDHandler

Parameters: notName the name of the Notation to check

checkUnparsedEntity

protected void checkUnparsedEntity(String entName)
Checks if an UnparsedEntity with the given name was declared in the DTD of the document for the current pipeline. If so, then the notation for the UnparsedEntity is checked. If that turns out okay, then the UnparsedEntity is passed to the root pipeline to be checked for conflicts, and sent to the root DTDHandler.

Parameters: entName the name of the UnparsedEntity to check

comment

public void comment(XMLString text, Augmentations augs)

copyFeatures

protected void copyFeatures(XMLComponentManager from, ParserConfigurationSettings to)

copyFeatures

protected void copyFeatures(XMLComponentManager from, XMLParserConfiguration to)

doctypeDecl

public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)

elementDecl

public void elementDecl(String name, String contentModel, Augmentations augmentations)

emptyElement

public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)

endAttlist

public void endAttlist(Augmentations augmentations)

endCDATA

public void endCDATA(Augmentations augs)

endConditional

public void endConditional(Augmentations augmentations)

endDocument

public void endDocument(Augmentations augs)

endDTD

public void endDTD(Augmentations augmentations)

endElement

public void endElement(QName element, Augmentations augs)

endExternalSubset

public void endExternalSubset(Augmentations augmentations)

endGeneralEntity

public void endGeneralEntity(String name, Augmentations augs)

endParameterEntity

public void endParameterEntity(String name, Augmentations augmentations)

externalEntityDecl

public void externalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)

getBaseURI

public String getBaseURI(int depth)
Gets the base URI that was in use at that depth

Parameters: depth

Returns: the base URI

getDocumentHandler

public XMLDocumentHandler getDocumentHandler()

getDocumentSource

public XMLDocumentSource getDocumentSource()

getDTDHandler

public XMLDTDHandler getDTDHandler()

getDTDSource

public XMLDTDSource getDTDSource()

getFeatureDefault

public Boolean getFeatureDefault(String featureId)
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.

Parameters: featureId The feature identifier.

Since: Xerces 2.2.0

getLanguage

public String getLanguage(int depth)
Gets the language that was in use at that depth.

Parameters: depth

Returns: the language

getPropertyDefault

public Object getPropertyDefault(String propertyId)
Returns the default state for a property, or null if this component does not want to report a default value for this property.

Parameters: propertyId The property identifier.

Since: Xerces 2.2.0

getRecognizedFeatures

public String[] getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.

getRecognizedProperties

public String[] getRecognizedProperties()
Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.

getRelativeBaseURI

protected String getRelativeBaseURI()
Returns a URI, relative to the include parent's base URI, of the current [base URI]. For instance, if the current [base URI] was "dir1/dir2/file.xml" and the include parent's [base URI] was "dir/", this would return "dir2/file.xml".

Returns: the relative URI

getRelativeURI

public String getRelativeURI(int depth)
Returns a relative URI, which when resolved against the base URI at the specified depth, will create the current base URI. This is accomplished by merged the literal system IDs.

Parameters: depth the depth at which to start creating the relative URI

Returns: a relative URI to convert the base URI at the given depth to the current base URI

getSawFallback

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.

Parameters: depth

getSawInclude

protected boolean getSawInclude(int depth)
Return whether an <include> was encountered at the specified depth, as an ancestor of the current item.

Parameters: depth

Returns:

getState

protected int getState(int depth)

getState

protected int getState()

handleFallbackElement

protected void handleFallbackElement()

handleIncludeElement

protected boolean handleIncludeElement(XMLAttributes attributes)

hasXIncludeNamespace

protected boolean hasXIncludeNamespace(QName element)
Returns true if the element has the namespace "http://www.w3.org/2001/XInclude"

Parameters: element the element to check

Returns: true if the element has the namespace "http://www.w3.org/2001/XInclude"

ignorableWhitespace

public void ignorableWhitespace(XMLString text, Augmentations augs)

ignoredCharacters

public void ignoredCharacters(XMLString text, Augmentations augmentations)

internalEntityDecl

public void internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations)

isFallbackElement

protected boolean isFallbackElement(QName element)
Checks if the element is an <fallback> element. The element must have the XInclude namespace, and a local name of "fallback".

Parameters: element the element to check

Returns: true if the element is an <fallback; element

See Also: hasXIncludeNamespace

isIncludeElement

protected boolean isIncludeElement(QName element)
Checks if the element is an <include> element. The element must have the XInclude namespace, and a local name of "include".

Parameters: element the element to check

Returns: true if the element is an <include> element

See Also: hasXIncludeNamespace

isRootDocument

protected boolean isRootDocument()

isTopLevelIncludedItem

protected boolean isTopLevelIncludedItem()
Returns true if the current element is a top level included item. This means it's either the child of a fallback element, or the top level item in an included document

Returns: true if the current element is a top level included item

isTopLevelIncludedItemViaFallback

protected boolean isTopLevelIncludedItemViaFallback()

isTopLevelIncludedItemViaInclude

protected boolean isTopLevelIncludedItemViaInclude()

modifyAugmentations

protected Augmentations modifyAugmentations(Augmentations augs)
Modify the augmentations. Add an [included] infoset item, if the current element is a top level included item.

Parameters: augs the Augmentations to modify.

Returns: the modified Augmentations

modifyAugmentations

protected Augmentations modifyAugmentations(Augmentations augs, boolean force)
Modify the augmentations. Add an [included] infoset item, if force is true, or if the current element is a top level included item.

Parameters: augs the Augmentations to modify. force whether to force modification

Returns: the modified Augmentations

notationDecl

public void notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations)

processAttributes

protected XMLAttributes processAttributes(XMLAttributes attributes)
Processes the XMLAttributes object of startElement() calls. Performs the following tasks:

Parameters: attributes

Returns:

processingInstruction

public void processingInstruction(String target, XMLString data, Augmentations augs)

processXMLBaseAttributes

protected void processXMLBaseAttributes(XMLAttributes attributes)
Search for a xml:base attribute, and if one is found, put the new base URI into effect.

processXMLLangAttributes

protected void processXMLLangAttributes(XMLAttributes attributes)
Search for a xml:lang attribute, and if one is found, put the new [language] into effect.

reportFatalError

protected void reportFatalError(String key)

reportFatalError

protected void reportFatalError(String key, Object[] args)

reportResourceError

protected void reportResourceError(String key)

reportResourceError

protected void reportResourceError(String key, Object[] args)

reset

public void reset(XMLComponentManager componentManager)

restoreBaseURI

protected void restoreBaseURI()
Discards the URIs at the top of the stack, and restores the ones beneath it.

restoreLanguage

public String restoreLanguage()
Discards the language at the top of the stack, and returns the one beneath it.

sameBaseURIAsIncludeParent

protected boolean sameBaseURIAsIncludeParent()
Returns true if the current [base URI] is the same as the [base URI] that was in effect on the include parent. This method should only be called when the current element is a top level included element, i.e. the direct child of a fallback element, or the root elements in an included document. The "include parent" is the element which, in the result infoset, will be the direct parent of the current element.

Returns: true if the [base URIs] are the same string

sameLanguageAsIncludeParent

protected boolean sameLanguageAsIncludeParent()
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]. This method should only be called when the current element is a top level included element, i.e. the direct child of a fallback element, or the root elements in an included document. The "include parent" is the element which, in the result infoset, will be the direct parent of the current element.

Returns: true if the [language] properties have the same value taking case-insensitivity into account as per [RFC 3066].

saveBaseURI

protected void saveBaseURI()
Saves the current base URI to the top of the stack.

saveLanguage

protected void saveLanguage(String language)
Saves the given language on the top of the stack.

Parameters: lanaguage the language to push onto the stack.

searchForRecursiveIncludes

protected boolean searchForRecursiveIncludes(XMLLocator includedSource)
Checks if the file indicated by the given XMLLocator has already been included in the current stack.

Parameters: includedSource the source to check for inclusion

Returns: true if the source has already been included

setDocumentHandler

public void setDocumentHandler(XMLDocumentHandler handler)

setDocumentSource

public void setDocumentSource(XMLDocumentSource source)

setDTDHandler

public void setDTDHandler(XMLDTDHandler handler)

setDTDSource

public void setDTDSource(XMLDTDSource source)

setFeature

public void setFeature(String featureId, boolean state)
Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.

Note: Components should silently ignore features that do not affect the operation of the component.

Parameters: featureId The feature identifier. state The state of the feature.

Throws: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.

setParent

protected void setParent(XIncludeHandler parent)
Set the parent of this XIncludeHandler in the tree

Parameters: parent

setProperty

public void setProperty(String propertyId, Object value)
Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.

Note: Components should silently ignore properties that do not affect the operation of the component.

Parameters: propertyId The property identifier. value The value of the property.

Throws: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.

setSawFallback

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.

Parameters: depth val

setSawInclude

protected void setSawInclude(int depth, boolean val)
Records that an <include> was encountered at the specified depth, as an ancestor of the current item.

Parameters: depth val

setState

protected void setState(int state)

startAttlist

public void startAttlist(String elementName, Augmentations augmentations)

startCDATA

public void startCDATA(Augmentations augs)

startConditional

public void startConditional(short type, Augmentations augmentations)

startDocument

public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs)
Event sent at the start of the document. A fatal error will occur here, if it is detected that this document has been processed before. This event is only passed on to the document handler if this is the root document.

startDTD

public void startDTD(XMLLocator locator, Augmentations augmentations)

startElement

public void startElement(QName element, XMLAttributes attributes, Augmentations augs)

startExternalSubset

public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)

startGeneralEntity

public void startGeneralEntity(String name, XMLResourceIdentifier resId, String encoding, Augmentations augs)

startParameterEntity

public void startParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations)

textDecl

public void textDecl(String version, String encoding, Augmentations augs)

unparsedEntityDecl

public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations)

xmlDecl

public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.