java.lang.Object | |
↳ | org.apache.xerces.impl.dtd.XMLDTDValidator |
Known Direct Subclasses |
Known Indirect Subclasses |
The DTD validator. The validator implements a document filter: receiving document events from the scanner; validating the content and structure; augmenting the InfoSet, if applicable; and notifying the parser of the information resulting from the validation process.
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:
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | BALANCE_SYNTAX_TREES | Feature identifier: balance syntax trees. | |||||||||
String | DATATYPE_VALIDATOR_FACTORY | Property identifier: datatype validator factory. | |||||||||
String | DYNAMIC_VALIDATION | Feature identifier: dynamic validation. | |||||||||
String | ERROR_REPORTER | Property identifier: error reporter. | |||||||||
String | GRAMMAR_POOL | Property identifier: grammar pool. | |||||||||
String | NAMESPACES | Feature identifier: namespaces. | |||||||||
String | PARSER_SETTINGS | ||||||||||
String | SYMBOL_TABLE | Property identifier: symbol table. | |||||||||
String | VALIDATION | Feature identifier: validation. | |||||||||
String | VALIDATION_MANAGER | ||||||||||
String | WARN_ON_DUPLICATE_ATTDEF | Feature identifier: warn on duplicate attdef |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fBalanceSyntaxTrees | Controls whether the DTD grammar produces balanced syntax trees. | ||||||||||
fDTDGrammar | DTD Grammar. | ||||||||||
fDTDValidation | Validation against only DTD | ||||||||||
fDatatypeValidatorFactory | Datatype validator factory. | ||||||||||
fDocLocation | |||||||||||
fDocumentHandler | Document handler. | ||||||||||
fDocumentSource | |||||||||||
fDynamicValidation | Dynamic validation. | ||||||||||
fErrorReporter | Error reporter. | ||||||||||
fGrammarBucket | Grammar bucket. | ||||||||||
fGrammarPool | |||||||||||
fNamespaceContext | Namespace support. | ||||||||||
fNamespaces | Namespaces. | ||||||||||
fSeenDoctypeDecl | True if seen DOCTYPE declaration. | ||||||||||
fSymbolTable | Symbol table. | ||||||||||
fValENTITIES | Datatype validator: ENTITIES. | ||||||||||
fValENTITY | Datatype validator: ENTITY. | ||||||||||
fValID | Datatype validator: ID. | ||||||||||
fValIDRef | Datatype validator: IDREF. | ||||||||||
fValIDRefs | Datatype validator: IDREFS. | ||||||||||
fValNMTOKEN | Datatype validator: NMTOKEN. | ||||||||||
fValNMTOKENS | Datatype validator: NMTOKENS. | ||||||||||
fValNOTATION | Datatype validator: NOTATION. | ||||||||||
fValidation | Validation. | ||||||||||
fValidationManager | |||||||||||
fValidationState | |||||||||||
fWarnDuplicateAttdef | warn on duplicate attribute definition, this feature works only when validation is true |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Character content.
| |||||||||||
Character content.
| |||||||||||
A comment.
| |||||||||||
Notifies of the presence of the DOCTYPE line in the document.
| |||||||||||
An empty element.
| |||||||||||
The end of a CDATA section.
| |||||||||||
The end of the document.
| |||||||||||
The end of an element.
| |||||||||||
This method notifies the end of a general entity.
| |||||||||||
Returns the document handler
| |||||||||||
Returns the document source
| |||||||||||
Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
| |||||||||||
Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
| |||||||||||
Returns a list of feature identifiers that are recognized by
this component.
| |||||||||||
Returns a list of property identifiers that are recognized by
this component.
| |||||||||||
Returns true if the validator has a DTD grammar
| |||||||||||
Ignorable whitespace.
| |||||||||||
A processing instruction.
| |||||||||||
Resets the component.
| |||||||||||
Sets the document handler to receive information about the document.
| |||||||||||
Sets the document source
| |||||||||||
Sets the state of a feature.
| |||||||||||
Sets the value of a property.
| |||||||||||
The start of a CDATA section.
| |||||||||||
The start of the document.
| |||||||||||
The start of an element.
| |||||||||||
This method notifies the start of a general entity.
| |||||||||||
Notifies of the presence of a TextDecl line in an entity.
| |||||||||||
Return true if validator must validate the document
| |||||||||||
Notifies of the presence of an XMLDecl line in the document.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add default attributes and validate.
| |||||||||||
Checks entities in attribute values for standalone VC.
| |||||||||||
Handle end element.
| |||||||||||
Handle element
| |||||||||||
initialization
| |||||||||||
Returns true if invalid standalone attribute definition.
| |||||||||||
Validate attributes in DTD fashion.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.xerces.impl.RevalidationHandler
| |||||||||||
From interface
org.apache.xerces.impl.dtd.XMLDTDValidatorFilter
| |||||||||||
From interface
org.apache.xerces.xni.XMLDocumentHandler
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLComponent
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLDocumentSource
|
Feature identifier: balance syntax trees.
Property identifier: datatype validator factory.
Feature identifier: dynamic validation.
Property identifier: error reporter.
Property identifier: grammar pool.
Feature identifier: namespaces.
Property identifier: symbol table.
Feature identifier: validation.
Feature identifier: warn on duplicate attdef
Controls whether the DTD grammar produces balanced syntax trees.
Validation against only DTD
Dynamic validation. This state of this feature is only useful when
the validation feature is set to true
.
Namespaces.
True if seen DOCTYPE declaration.
Validation.
warn on duplicate attribute definition, this feature works only when validation is true
Default constructor.
Character content.
data | The character data. |
---|---|
augs | Augmentations |
Character content.
text | The content. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
A comment.
text | The text in the comment. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by application to signal an error. |
---|
Notifies of the presence of the DOCTYPE line in the document.
rootElement | The name of the root element. |
---|---|
publicId | The public identifier if an external DTD or null if the external DTD is specified using SYSTEM. |
systemId | The system identifier if an external DTD, null otherwise. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
An empty element.
element | The name of the element. |
---|---|
attributes | The element attributes. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
The end of a CDATA section.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The end of the document.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The end of an element.
element | The name of the element. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
This method notifies the end of a general entity.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the entity. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
featureId | The feature identifier. |
---|
Returns the default state for a property, or null if this component does not want to report a default value for this property.
propertyId | The property identifier. |
---|
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.
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.
Returns true if the validator has a DTD grammar
Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
text | The ignorable whitespace. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.
Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.
target | The target. |
---|---|
data | The data or null if none specified. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
componentManager | The component manager. |
---|
XMLConfigurationException |
---|
Sets the document handler to receive information about the document.
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.
featureId | The feature identifier. |
---|---|
state | The state of the feature. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |
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.
propertyId | The property identifier. |
---|---|
value | The value of the property. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |
The start of a CDATA section.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The start of the document.
locator | The system identifier of the entity if the entity is external, null otherwise. |
---|---|
encoding | 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). |
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. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
The start of an element.
element | The name of the element. |
---|---|
attributes | The element attributes. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
This method notifies the start of a general entity.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the general entity. |
---|---|
identifier | The resource identifier. |
encoding | 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). |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startParameterEntity call.
Note: This method is only called for external parameter entities referenced in the DTD.
version | The XML version, or null if not specified. |
---|---|
encoding | The IANA encoding name of the entity. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
Return true if validator must validate the document
Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.
version | The XML version. |
---|---|
encoding | The IANA encoding name of the document, or null if not specified. |
standalone | The standalone value, or null if not specified. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Add default attributes and validate.
XNIException |
---|
Checks entities in attribute values for standalone VC.
Handle end element.
XNIException |
---|
initialization
Returns true if invalid standalone attribute definition.
Validate attributes in DTD fashion.
XNIException |
---|