APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.dtd

public Class XMLDTDProcessor

extends Object
implements XMLComponent, XMLDTDFilter, XMLDTDContentModelFilter
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelFilter, com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource, com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler, com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter, com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource, com.sun.org.apache.xerces.internal.xni.XMLDTDHandler, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader
Imports
com.sun.org.apache.xerces.internal.impl.Constants, .XMLErrorReporter, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.util.SymbolTable, .XMLChar, .XMLSymbols, com.sun.org.apache.xerces.internal.xni.Augmentations, .XMLDTDContentModelHandler, .XMLDTDHandler, .XMLLocator, .XMLResourceIdentifier, .XMLString, .XNIException, com.sun.org.apache.xerces.internal.xni.grammars.Grammar, .XMLGrammarDescription, .XMLGrammarPool, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent, .XMLComponentManager, .XMLConfigurationException, .XMLDTDContentModelFilter, .XMLDTDContentModelSource, .XMLDTDFilter, .XMLDTDSource, java.util.ArrayList, .HashMap, .List, .Locale, .Map, .StringTokenizer

The DTD processor. The processor implements a DTD filter: receiving DTD events from the DTD scanner; validating the content and structure; building a grammar, if applicable; and notifying the DTDHandler of the information resulting from the process.

This component requires the following features and properties from the component manager that uses it:

Author
Neil Graham, IBM

Field Summary

Modifier and TypeField and Description
protected static final String
DTD_VALIDATOR

Property identifier: validator .

protected static final String
ERROR_REPORTER

Property identifier: error reporter.

protected XMLDTDContentModelHandler
fDTDContentModelHandler

DTD content model handler.

protected XMLDTDContentModelSource
fDTDContentModelSource

DTD content model source.

private String
fDTDElementDeclName

DTD element declaration name.

private final List<String>
fDTDElementDecls

Element declarations in DTD.

protected DTDGrammar
fDTDGrammar

DTD Grammar.

protected XMLDTDHandler
fDTDHandler

DTD handler.

protected XMLDTDSource
fDTDSource

DTD source.

protected boolean
fDTDValidation

Validation against only DTD

private static final Boolean[]
FEATURE_DEFAULTS

Feature defaults.

private final XMLEntityDecl
fEntityDecl

Temporary entity declaration.

protected XMLErrorReporter
fErrorReporter

Error reporter.

protected DTDGrammarBucket
fGrammarBucket

Grammar bucket.

protected XMLGrammarPool
protected boolean
fInDTDIgnore

True if in an ignore conditional section of the DTD.

protected Locale
private boolean
fMixed

Mixed.

private final List<String>
fMixedElementTypes

Mixed element type "hash".

private final Map<String, String>
fNDataDeclNotations

Notation declaration hash.

private Map<String, String>
fNotationEnumVals

NOTATION enumeration values.

private boolean
fPerformValidation

Perform validation.

protected SymbolTable
fSymbolTable

Symbol table.

private Map<String, String>
fTableOfIDAttributeNames

ID attribute names.

private Map<String, String>
fTableOfNOTATIONAttributeNames

NOTATION attribute names.

protected boolean
fValidation

Validation.

protected XMLDTDValidator
protected boolean
fWarnDuplicateAttdef

warn on duplicate attribute definition, this feature works only when validation is true

protected boolean
fWarnOnUndeclaredElemdef

warn on undeclared element referenced in content model, this feature only works when valiation is true

protected static final String
GRAMMAR_POOL

Property identifier: grammar pool.

protected static final String
NOTIFY_CHAR_REFS

Feature identifier: notify character references.

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
SYMBOL_TABLE

Property identifier: symbol table.

private static final int
TOP_LEVEL_SCOPE

Top level scope (-1).

protected static final String
VALIDATION

Feature identifier: validation.

protected static final String
WARN_ON_DUPLICATE_ATTDEF

Feature identifier: warn on duplicate attdef

protected static final String
WARN_ON_UNDECLARED_ELEMDEF

Feature identifier: warn on undeclared element referenced in content model.

Constructor Summary

AccessConstructor and Description
public
XMLDTDProcessor()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
any(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.any.

A content model of ANY.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.attributeDecl.

An attribute declaration.

private void
checkDeclaredElements(DTDGrammar grammar)

Checks that all elements referenced in content models have been declared.

private void
checkDeclaredElements(DTDGrammar grammar, int elementIndex, int contentSpecIndex, XMLContentSpec contentSpec)

Does a recursive (if necessary) check on the specified element's content spec to make sure that all children refer to declared elements.

protected static void
checkStandaloneEntityRef(String name, DTDGrammar
grammar to which entity belongs
grammar
,
XMLEntityDecl
empty entity declaration to put results in
tempEntityDecl
,
XMLErrorReporter
error reporter to send errors to
errorReporter
)

Check standalone entity reference.

public void
comment(XMLString
The text in the comment.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.comment.

A comment.

public void
element(String
The name of the referenced element.
elementName
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.element.

A referenced element in a mixed or children content model.

public void
elementDecl(String
The name of the element.
name
,
String
The element content model.
contentModel
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.elementDecl.

An element declaration.

public void
empty(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.empty.

A content model of EMPTY.

public void
endAttlist(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.endAttlist.

The end of an attribute list.

public void
endConditional(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.endConditional.

The end of a conditional section.

public void
endContentModel(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.endContentModel.

The end of a content model.

public void
endDTD(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.endDTD.

The end of the DTD.

public void
endExternalSubset(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.endExternalSubset.

The end of the DTD external subset.

public void
endGroup(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.endGroup.

The end of a group for mixed or children content models.

public void
endParameterEntity(String
The name of the parameter entity.
name
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.endParameterEntity.

This method notifies the end of a parameter entity.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.externalEntityDecl.

An external entity declaration.

public XMLDTDContentModelHandler

Returns:

dtdContentModelHandler The DTD content model handler.
getDTDContentModelHandler
()

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource.getDTDContentModelHandler.

Gets the DTD content model handler.

public XMLDTDContentModelSource
public XMLDTDHandler

Returns:

The DTD handler.
getDTDHandler
()

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource.getDTDHandler.

Returns the DTD handler.

public XMLDTDSource
public Boolean
getFeatureDefault(String
The feature identifier.
featureId
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getFeatureDefault.

Returns the default state for a feature, or null if this component does not want to report a default value for this feature.

public Object
getPropertyDefault(String
The property identifier.
propertyId
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getPropertyDefault.

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.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getRecognizedFeatures.

Returns a list of feature identifiers that are recognized by this component.

public String[]
getRecognizedProperties()

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getRecognizedProperties.

Returns a list of property identifiers that are recognized by this component.

public void
ignoredCharacters(XMLString
The ignored text.
text
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.ignoredCharacters.

Characters within an IGNORE conditional section.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.internalEntityDecl.

An internal entity declaration.

protected boolean
protected boolean
private boolean

Returns:

Whether the value was changed or not.
normalizeDefaultAttrValue
(XMLString
The value to normalize
value
)

Normalize the attribute value of a non CDATA default attribute collapsing sequences of space characters (x20)

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.notationDecl.

A notation declaration

public void
occurrence(short
The occurrence count for the last element or group.
occurrence
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.occurrence.

The occurrence count for a child in a children content model or for the mixed content model group.

public void
pcdata(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.pcdata.

The appearance of "#PCDATA" within a group signifying a mixed content model.

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 com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.processingInstruction.

A processing instruction.

public void
protected void
public void
separator(short
The type of children separator.
separator
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.separator.

The separator between choices or sequences of a mixed or children content model.

public void
setDTDContentModelHandler(XMLDTDContentModelHandler
The DTD content model handler.
dtdContentModelHandler
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource.setDTDContentModelHandler.

Sets the DTD content model handler.

public void
public void
public void
public void
setFeature(String
The feature identifier.
featureId
,
boolean
The state of the feature.
state
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setFeature.

Sets the state of a feature.

public void
setProperty(String
The property identifier.
propertyId
,
Object
The value of the property.
value
)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setProperty.

Sets the value of a property.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.startAttlist.

The start of an attribute list.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.startConditional.

The start of a conditional section.

public void
startContentModel(String
The name of the element.
elementName
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.startContentModel.

The start of a content model.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.startDTD.

The start of the DTD.

public void
startExternalSubset(XMLResourceIdentifier identifier, Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.startExternalSubset.

The start of the DTD external subset.

public void
startGroup(Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler.startGroup.

A start of either a mixed or children content model.

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.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.startParameterEntity.

This method notifies of the start of a parameter entity.

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 com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.textDecl.

Notifies of the presence of a TextDecl line in an entity.

public void
unparsedEntityDecl(String
The name of the entity.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this entity.
identifier
,
String
The name of the notation.
notation
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLDTDHandler.unparsedEntityDecl.

An unparsed entity declaration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait