Top Description Fields Methods
org.apache.xerces.xni

public Interface XMLDTDHandler

Known Direct Subinterfaces
org.apache.xerces.xni.parser.XMLDTDFilter
Known Direct Implementers
org.apache.xerces.impl.dtd.DTDGrammar, org.apache.xerces.impl.xs.opti.DefaultXMLDocumentHandler, org.apache.xerces.parsers.AbstractXMLDocumentParser, org.apache.xerces.parsers.DOMParserImpl.AbortHandler, org.apache.xerces.parsers.DTDParser
Imports
org.apache.xerces.xni.parser.XMLDTDSource

The DTD handler interface defines callback methods to report information items in the DTD of an XML document. Parser components interested in DTD information implement this interface and are registered as the DTD handler on the DTD source.
Author
Andy Clark, IBM
Version
$Id: XMLDTDHandler.java 447247 2006-09-18 05:23:52Z mrglavas $
See Also
XMLDTDContentModelHandler

Field Summary

Modifier and TypeField and Description
public static final short
CONDITIONAL_IGNORE

Conditional section: IGNORE.

public static final short
CONDITIONAL_INCLUDE

Conditional section: INCLUDE.

Method Summary

Modifier and TypeMethod and Description
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
)

An attribute declaration.

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

A comment.

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
)

An element declaration.

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

The end of an attribute list.

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

The end of a conditional section.

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

The end of the DTD.

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

The end of the DTD external subset.

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

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

An external entity declaration.

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

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

An internal entity declaration.

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
)

A notation declaration

public void
processingInstruction(String
The target.
target
,
XMLString
The data or null if none specified.
data
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

A processing instruction.

public 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
)

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

The start of a conditional section.

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
)

The start of the DTD.

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

The start of the DTD external subset.

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
)

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

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 unparsed entity declaration.
identifier
,
String
The name of the notation.
notation
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

An unparsed entity declaration.

Field Detail

CONDITIONAL_IGNOREback to summary
public static final short CONDITIONAL_IGNORE

Conditional section: IGNORE.

See Also
CONDITIONAL_INCLUDE
CONDITIONAL_INCLUDEback to summary
public static final short CONDITIONAL_INCLUDE

Conditional section: INCLUDE.

See Also
CONDITIONAL_IGNORE

Method Detail

attributeDeclback to summary
public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations) throws XNIException

An attribute declaration.

Parameters
elementName:String

The name of the element that this attribute is associated with.

attributeName:String

The name of the attribute.

type:String

The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".

enumeration:String[]

If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.

defaultType:String

The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.

defaultValue:XMLString

The attribute default value, or null if no default value is specified.

nonNormalizedDefaultValue:XMLString

The attribute default value with no normalization performed, or null if no default value is specified.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
commentback to summary
public void comment(XMLString text, Augmentations augmentations) throws XNIException

A comment.

Parameters
text:XMLString

The text in the comment.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by application to signal an error.
elementDeclback to summary
public void elementDecl(String name, String contentModel, Augmentations augmentations) throws XNIException

An element declaration.

Parameters
name:String

The name of the element.

contentModel:String

The element content model.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endAttlistback to summary
public void endAttlist(Augmentations augmentations) throws XNIException

The end of an attribute list.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endConditionalback to summary
public void endConditional(Augmentations augmentations) throws XNIException

The end of a conditional section.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endDTDback to summary
public void endDTD(Augmentations augmentations) throws XNIException

The end of the DTD.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endExternalSubsetback to summary
public void endExternalSubset(Augmentations augmentations) throws XNIException

The end of the DTD external subset.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endParameterEntityback to summary
public void endParameterEntity(String name, Augmentations augmentations) throws XNIException

This method notifies the end of a parameter entity. Parameter entity names begin with a '%' character.

Parameters
name:String

The name of the parameter entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
externalEntityDeclback to summary
public void externalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

An external entity declaration.

Parameters
name:String

The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this external entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
getDTDSourceback to summary
public XMLDTDSource getDTDSource()
ignoredCharactersback to summary
public void ignoredCharacters(XMLString text, Augmentations augmentations) throws XNIException

Characters within an IGNORE conditional section.

Parameters
text:XMLString

The ignored text.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
internalEntityDeclback to summary
public void internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations) throws XNIException

An internal entity declaration.

Parameters
name:String

The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.

text:XMLString

The value of the entity.

nonNormalizedText: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.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
notationDeclback to summary
public void notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

A notation declaration

Parameters
name:String

The name of the notation.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this notation.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
processingInstructionback to summary
public void processingInstruction(String target, XMLString data, Augmentations augmentations) throws XNIException

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.

Parameters
target:String

The target.

data:XMLString

The data or null if none specified.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
setDTDSourceback to summary
public void setDTDSource(XMLDTDSource source)
startAttlistback to summary
public void startAttlist(String elementName, Augmentations augmentations) throws XNIException

The start of an attribute list.

Parameters
elementName:String

The name of the element that this attribute list is associated with.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startConditionalback to summary
public void startConditional(short type, Augmentations augmentations) throws XNIException

The start of a conditional section.

Parameters
type:short

The type of the conditional section. This value will either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
CONDITIONAL_INCLUDE, CONDITIONAL_IGNORE
startDTDback to summary
public void startDTD(XMLLocator locator, Augmentations augmentations) throws XNIException

The start of the DTD.

Parameters
locator: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.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startExternalSubsetback to summary
public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

The start of the DTD external subset.

Parameters
identifier:XMLResourceIdentifier

The resource identifier.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startParameterEntityback to summary
public void startParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations) throws XNIException

This method notifies of the start of a parameter entity. The parameter entity name start with a '%' character.

Parameters
name:String

The name of the parameter entity.

identifier:XMLResourceIdentifier

The resource identifier.

encoding: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).

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
textDeclback to summary
public void textDecl(String version, String encoding, Augmentations augmentations) throws XNIException

Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startEntity call.

Note

This method is only called for external parameter entities referenced in the DTD.

Parameters
version:String

The XML version, or null if not specified.

encoding:String

The IANA encoding name of the entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
unparsedEntityDeclback to summary
public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations) throws XNIException

An unparsed entity declaration.

Parameters
name:String

The name of the entity.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this unparsed entity declaration.

notation:String

The name of the notation.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.