Formerly, this component also handled DTD events and grammar construction. To facilitate the development of a meaningful DTD grammar caching/preparsing framework, this functionality has been moved into the XMLDTDLoader class. Therefore, this class no longer implements the DTDFilter or DTDContentModelFilter interfaces.
This component requires the following features and properties from the component manager that uses it:
| Modifier and Type | Field and Description |
|---|---|
| protected static final String | BALANCE_SYNTAX_TREES
Feature identifier: balance syntax trees. |
| protected static final String | DATATYPE_VALIDATOR_FACTORY
Property identifier: datatype validator factory. |
| private static final boolean | DEBUG_ATTRIBUTES
Compile to true to debug attributes. |
| private static final boolean | DEBUG_ELEMENT_CHILDREN
Compile to true to debug element children. |
| protected static final String | DYNAMIC_VALIDATION
Feature identifier: dynamic validation. |
| protected static final String | ERROR_REPORTER
Property identifier: error reporter. |
| protected boolean | fBalanceSyntaxTrees
Controls whether the DTD grammar produces balanced syntax trees. |
| private final StringBuilder | fBuffer
Temporary string buffers. |
| private int[] | fContentSpecTypeStack
Content spec type stack. |
| private int | fCurrentContentSpecType
Current content spec type. |
| private final QName | fCurrentElement
Current element name. |
| private int | fCurrentElementIndex
Current element index. |
| protected DTDDVFactory | fDatatypeValidatorFactory
Datatype validator factory. |
| protected XMLLocator | |
| protected XMLDocumentHandler | fDocumentHandler
Document handler. |
| protected XMLDocumentSource | |
| protected DTDGrammar | fDTDGrammar
DTD Grammar. |
| protected boolean | fDTDValidation
Validation against only DTD |
| protected boolean | fDynamicValidation
Dynamic validation. |
| private static final Boolean[] | FEATURE_DEFAULTS
Feature defaults. |
| private QName[] | fElementChildren
Element children. |
| private int | fElementChildrenLength
Element children count. |
| private int[] | fElementChildrenOffsetStack
Element children offset stack. |
| private int | fElementDepth
Element depth. |
| private int[] | fElementIndexStack
Element index stack. |
| private QName[] | fElementQNamePartsStack
Element name stack. |
| private final XMLEntityDecl | fEntityDecl
Temporary entity declaration. |
| protected XMLErrorReporter | fErrorReporter
Error reporter. |
| protected DTDGrammarBucket | fGrammarBucket
Grammar bucket. |
| protected XMLGrammarPool | |
| private boolean | |
| private boolean | fInElementContent
True if inside of element content. |
| protected NamespaceContext | fNamespaceContext
Namespace support. |
| protected boolean | fNamespaces
Namespaces. |
| private boolean | fPerformValidation
Perform validation. |
| private final QName | fRootElement
The root element name. |
| private String | fSchemaType
Schema type: None, DTD, Schema |
| protected boolean | fSeenDoctypeDecl
True if seen DOCTYPE declaration. |
| private boolean | fSeenRootElement
True if seen the root element. |
| protected SymbolTable | fSymbolTable
Symbol table. |
| private final XMLAttributeDecl | fTempAttDecl
Temporary atribute declaration. |
| private final XMLElementDecl | fTempElementDecl
Temporary element declaration. |
| private final QName | fTempQName
Temporary qualified name. |
| protected DatatypeValidator | fValENTITIES
Datatype validator: ENTITIES. |
| protected DatatypeValidator | fValENTITY
Datatype validator: ENTITY. |
| protected DatatypeValidator | fValID
Datatype validator: ID. |
| protected boolean | fValidation
Validation. |
| protected ValidationManager | |
| protected final ValidationState | |
| protected DatatypeValidator | fValIDRef
Datatype validator: IDREF. |
| protected DatatypeValidator | fValIDRefs
Datatype validator: IDREFS. |
| protected DatatypeValidator | fValNMTOKEN
Datatype validator: NMTOKEN. |
| protected DatatypeValidator | fValNMTOKENS
Datatype validator: NMTOKENS. |
| protected DatatypeValidator | fValNOTATION
Datatype validator: NOTATION. |
| protected boolean | fWarnDuplicateAttdef
warn on duplicate attribute definition, this feature works only when validation is true |
| protected static final String | GRAMMAR_POOL
Property identifier: grammar pool. |
| protected static final String | NAMESPACES
Feature identifier: namespaces. |
| 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. |
| protected static final String | VALIDATION
Feature identifier: validation. |
| protected static final String | |
| protected static final String | WARN_ON_DUPLICATE_ATTDEF
Feature identifier: warn on duplicate attdef |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addDTDDefaultAttrsAndValidate(QName elementName, int elementIndex, XMLAttributes attributes)
Add default attributes and validate. |
| public boolean | characterData(String data, Augmentations augs)
Implements com. Character content. |
| public void | characters(XMLString
The content. text, Augmentations Additional information that may include infoset augmentations augs)Implements com. Character content. |
| private void | |
| private int | Returns: The value -1 if fully valid, else the 0 based index of the child that first failed. If the value returned is equal to the number of children, then additional content is required to reach a valid ending state.The index within the elementIndex, QName[] ElementDeclPool of this
element.The children of this element. children, int childOffset, int The number of entries in the childCount)children array.Check that the content of an element is valid. |
| public void | comment(XMLString
The text in the comment. text, Augmentations Additional information that may include infoset augmentations augs)Implements com. A comment. |
| 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 com. Notifies of the presence of the DOCTYPE line in the document. |
| 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 com. An empty element. |
| public void | endCDATA(Augmentations
Additional information that may include infoset augmentations augs)Implements com. The end of a CDATA section. |
| public void | endDocument(Augmentations
Additional information that may include infoset augmentations augs)Implements com. The end of the document. |
| public void | endElement(QName
The name of the element. element, Augmentations Additional information that may include infoset augmentations augs)Implements com. The end of an element. |
| public void | endGeneralEntity(String
The name of the entity. name, Augmentations Additional information that may include infoset augmentations augs)Implements com. This method notifies the end of a general entity. |
| protected void | |
| private void | |
| private String | |
| public XMLDocumentHandler | getDocumentHandler()
Implements com. Returns the document handler |
| public XMLDocumentSource | getDocumentSource()
Implements com. Returns the document source |
| protected String | getExternalEntityRefInAttrValue(String nonNormalizedValue)
Checks entities in attribute values for standalone VC. |
| 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. |
| pack-priv DTDGrammarBucket | |
| 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 void | |
| protected boolean | Returns: true if validator is removed from the pipelineHandle element |
| public final boolean | hasGrammar()
Implements com. Returns true if the validator has a DTD grammar |
| public void | ignorableWhitespace(XMLString
The ignorable whitespace. text, Augmentations Additional information that may include infoset augmentations augs)Implements com. Ignorable whitespace. |
| protected void | |
| protected boolean | invalidStandaloneAttDef(QName element, QName attribute)
Returns true if invalid standalone attribute definition. |
| protected boolean | |
| private boolean | normalizeAttrValue(XMLAttributes
The list of attributes attributes, int The index of the attribute to normalize index)Normalize the attribute value of a non CDATA attributes collapsing sequences of space characters (x20) |
| 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. A processing instruction. |
| public void | reset(XMLComponentManager componentManager)
Implements com. Resets the component. |
| private final void | |
| public void | setDocumentHandler(XMLDocumentHandler documentHandler)
Implements com. Sets the document handler to receive information about the document. |
| public void | setDocumentSource(XMLDocumentSource source)
Implements com. Sets the document source |
| public void | setFeature(String
The feature identifier. featureId, boolean The state of the feature. state)Implements com. Sets the state of a feature. |
| public void | setProperty(String
The property identifier. propertyId, Object The value of the property. value)Implements com. Sets the value of a property. |
| public void | startCDATA(Augmentations
Additional information that may include infoset augmentations augs)Implements com. The start of a CDATA section. |
| public void | startDocument(XMLLocator
The system identifier of the entity if the entity
is external, null otherwise. 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 com. The start of the document. |
| 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 com. The start of an element. |
| public void | startGeneralEntity(String
The name of the general 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 entities or a document entity that is
parsed from a java.io.Reader). encoding, Augmentations Additional information that may include infoset augmentations augs)Implements com. This method notifies the start of a general entity. |
| protected void | |
| 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. Notifies of the presence of a TextDecl line in an entity. |
| public final boolean | validate()
Implements com. Return true if validator must validate the document |
| protected void | validateDTDattribute(QName element, String attValue, XMLAttributeDecl attributeDecl)
Validate attributes in DTD fashion. |
| 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 com. Notifies of the presence of an XMLDecl line in the document. |