APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xerces.internal.parsers

public abstract Class DTDParser

extends XMLGrammarParser
implements XMLDTDHandler, XMLDTDContentModelHandler
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler, com.sun.org.apache.xerces.internal.xni.XMLDTDHandler
Imports
com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar, com.sun.org.apache.xerces.internal.util.SymbolTable, com.sun.org.apache.xerces.internal.xni.Augmentations, .XMLString, .XMLDTDContentModelHandler, .XMLDTDHandler, .XMLLocator, .XNIException, .XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner

Field Summary

Modifier and TypeField and Description
protected XMLDTDScanner
fDTDScanner

fDTDScanner

Inherited from com.sun.org.apache.xerces.internal.parsers.XMLGrammarParser:
fDatatypeValidatorFactory

Constructor Summary

AccessConstructor and Description
public
DTDParser(SymbolTable symbolTable)

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", 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 nonNormalizedDefaultValue, Augmentations augmentations)

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

An attribute declaration.

public void
childrenElement(String
The name of the referenced element.
elementName
)

A referenced element in a children content model.

public void
childrenEndGroup()

The end of a children group.

public void
childrenOccurrence(short
The occurrence count for the last children element or children group.
occurrence
)

The occurrence count for a child in a children content model.

public void
childrenSeparator(short
The type of children separator.
separator
)

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

public void
childrenStartGroup()

The start of a children group.

public void
comment(XMLString
The text in the comment.
text
,
Augmentations augmentations)

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

A comment.

public void
elementDecl(String
The name of the element.
name
,
String
The element content model.
contentModel
,
Augmentations augmentations)

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

An element declaration.

public void
endAttlist(Augmentations augmentations)

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

The end of an attribute list.

public void
endConditional(Augmentations augmentations)

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

The end of a conditional section.

public void
endContentModel()

The end of a content model.

public void
public void
endEntity(String
The name of the entity.
name
,
Augmentations augmentations)

This method notifies the end of an entity.

public void
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 entity.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

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

An external entity declaration.

public DTDGrammar

Returns:

the grammar created by this parser
getDTDGrammar
()

getDTDGrammar

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

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

An internal entity declaration.

public void
mixedElement(String
The name of the referenced element.
elementName
)

A referenced element in a mixed content model.

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
)

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

A notation declaration

public void
processingInstruction(String
The target.
target
,
XMLString
The data or null if none specified.
data
,
Augmentations augmentations)

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

A processing instruction.

public void
startAttlist(String
The name of the element that this attribute list is associated with.
elementName
,
Augmentations augmentations)

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

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
,
short
The content model type.
type
)

The start of a content model.

public void
public void
startEntity(String
The name of the entity.
name
,
String
The public identifier of the entity if the entity is external, null otherwise.
publicId
,
String
The system identifier of the entity if the entity is external, null otherwise.
systemId
,
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
)

This method notifies of the start of an entity.

public void
public void
textDecl(String
The XML version, or null if not specified.
version
,
String
The IANA encoding name of the entity.
encoding
)

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

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

An unparsed entity declaration.

Field Detail

fDTDScannerback to summary
protected XMLDTDScanner fDTDScanner

fDTDScanner

Constructor Detail

DTDParserback to summary
public DTDParser(SymbolTable symbolTable)

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

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

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", 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.

Exceptions
XNIException:
Thrown by handler to signal an error.
childrenElementback to summary
public void childrenElement(String elementName) throws XNIException

A referenced element in a children content model.

Parameters
elementName:String

The name of the referenced element.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
childrenEndGroupback to summary
public void childrenEndGroup() throws XNIException

The end of a children group.

Note

This method is only called after a call to the startContentModel method where the type is TYPE_CHILDREN.

See Also
com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
childrenOccurrenceback to summary
public void childrenOccurrence(short occurrence) throws XNIException

The occurrence count for a child in a children content model.

Note

This method is only called after a call to the startContentModel method where the type is TYPE_CHILDREN.

Parameters
occurrence:short

The occurrence count for the last children element or children group.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
XMLDTDContentModelHandler#OCCURS_ZERO_OR_ONE, XMLDTDContentModelHandler#OCCURS_ZERO_OR_MORE, XMLDTDContentModelHandler#OCCURS_ONE_OR_MORE, com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
childrenSeparatorback to summary
public void childrenSeparator(short separator) throws XNIException

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

Note

This method is only called after a call to the startContentModel method where the type is TYPE_CHILDREN.

Parameters
separator:short

The type of children separator.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
XMLDTDContentModelHandler#SEPARATOR_CHOICE, XMLDTDContentModelHandler#SEPARATOR_SEQUENCE, com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
childrenStartGroupback to summary
public void childrenStartGroup() throws XNIException

The start of a children group.

Note

This method is only called after a call to the startContentModel method where the type is TYPE_CHILDREN.

Note

Children groups can be nested and have associated occurrence counts.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
commentback to summary
public void comment(XMLString text, Augmentations augmentations) throws XNIException

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

A comment.

Parameters
text:XMLString

The text in the comment.

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

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

An element declaration.

Parameters
name:String

The name of the element.

contentModel:String

The element content model.

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

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

The end of an attribute list.

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

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

The end of a conditional section.

Exceptions
XNIException:
Thrown by handler to signal an error.
endContentModelback to summary
public void endContentModel() throws XNIException

The end of a content model.

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

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

The end of the DTD.

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

This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" and parameter entity names start with '%'.

Note

Since the DTD is an entity, the handler will be notified of the end of the DTD entity by calling the endEntity method with the entity name "[dtd]" after calling the endDTD method.

Parameters
name:String

The name of the entity.

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

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

The end of the external subset.

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

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

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 entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
getDTDGrammarback to summary
public DTDGrammar getDTDGrammar()

getDTDGrammar

Returns:DTDGrammar

the grammar created by this parser

internalEntityDeclback to summary
public void internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations) throws XNIException

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

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.

Exceptions
XNIException:
Thrown by handler to signal an error.
mixedElementback to summary
public void mixedElement(String elementName) throws XNIException

A referenced element in a mixed content model. If the mixed content model only allows text content, then this method will not be called for that model. However, if this method is called for a mixed content model, then the zero or more occurrence count is implied.

Note

This method is only called after a call to the startContentModel method where the type is TYPE_MIXED.

Parameters
elementName:String

The name of the referenced element.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_MIXED
notationDeclback to summary
public void notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

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

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

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

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.

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

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

The start of an attribute list.

Parameters
elementName:String

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

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

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

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.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
XMLDTDHandler#CONDITIONAL_INCLUDE, XMLDTDHandler#CONDITIONAL_IGNORE
startContentModelback to summary
public void startContentModel(String elementName, short type) throws XNIException

The start of a content model. Depending on the type of the content model, specific methods may be called between the call to the startContentModel method and the call to the endContentModel method.

Parameters
elementName:String

The name of the element.

type:short

The content model type.

Exceptions
XNIException:
Thrown by handler to signal an error.
See Also
com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_EMPTY, com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_ANY, com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_MIXED, com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
startDTDback to summary
public void startDTD(XMLLocator locator, Augmentations augmentations) throws XNIException

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

The start of the DTD.

Exceptions
XNIException:
Thrown by handler to signal an error.
startEntityback to summary
public void startEntity(String name, String publicId, String systemId, String encoding) throws XNIException

This method notifies of the start of an entity. The DTD has the pseudo-name of "[dtd]" and parameter entity names start with '%'.

Note

Since the DTD is an entity, the handler will be notified of the start of the DTD entity by calling the startEntity method with the entity name "[dtd]" before calling the startDTD method.

Parameters
name:String

The name of the entity.

publicId:String

The public identifier of the entity if the entity is external, null otherwise.

systemId:String

The system identifier of the entity if the entity is external, null otherwise.

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

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

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

The start of the external subset.

Exceptions
XNIException:
Thrown by handler to signal an error.
textDeclback to summary
public void textDecl(String version, String encoding) 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.

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

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

An unparsed entity declaration.

Parameters
name:String

The name of the entity.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this entity.

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.