|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
When parsing XML documents, DTD related events are signaled through this interface. Examples include the beginning and end of the DTD, entity declarations, and parts of the <!DOCTYPE...> declaration. This interface supports:
Events signaled through the DTDHandler interface will only signaled after at startDtd event and before an endDtd event.
Other than the support to recreate the DOCTYPE declaration, parameter entities are not exposed.
Parser
Method Summary | |
void |
attributeDecl(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeType,
java.lang.String[] options,
java.lang.String defaultValue,
boolean isFixed,
boolean isRequired)
Reports an attribute declaration found within the DTD. |
void |
elementDecl(java.lang.String elementName,
java.lang.String contentModel)
Reports an element declaration found within the DTD. |
void |
endDtd()
Receive notification of the end of a DTD. |
void |
externalDtdDecl(java.lang.String publicId,
java.lang.String systemId)
Reports the optional unnamed parameter entity which is processed after the internal DTD subset. |
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Receive notification of an external parsed entity declaration event. |
void |
internalDtdDecl(java.lang.String internalSubset)
Reports the internal DTD subset, as unparsed markup declarations. |
void |
internalEntityDecl(java.lang.String name,
java.lang.String value)
Receive notification of a internal parsed entity declaration event. |
void |
startDtd(java.lang.String rootName)
Receive notification of the beginning of a Document Type Declaration (DTD). |
Methods inherited from interface org.xml.sax.DTDHandler |
notationDecl,
unparsedEntityDecl |
Method Detail |
public void startDtd(java.lang.String rootName) throws SAXException
rootName
- The declared name of the root element, which
may be different from the actual name if the document is not
valid.endDtd()
public void externalDtdDecl(java.lang.String publicId, java.lang.String systemId) throws SAXException
publicId
- The entity's public identifier, or null if
none was given.systemId
- The entity's system identifier.internalDtdDecl(java.lang.String)
public void internalDtdDecl(java.lang.String internalSubset) throws SAXException
internalSubset
- The document's internal subset, as unparsed
markup declarations, comments, and processing instructions.externalDtdDecl(java.lang.String, java.lang.String)
public void internalEntityDecl(java.lang.String name, java.lang.String value) throws SAXException
name
- The internal entity name.value
- the value of the entity, which may include unexpanded
entity references. Character references will have been expanded.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
If a system identifier is present, and it is a relative URL, the parser will have resolved it fully before passing it through this method to a listener.
name
- The entity name.publicId
- The entity's public identifier, or null if
none was given.systemId
- The entity's system identifier.DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void elementDecl(java.lang.String elementName, java.lang.String contentModel) throws SAXException
elementName
- The name of the element; this includes a namespace
prefix if one was used within the DTD.contentModel
- The content model as defined in the DTD, with
any whitespace removed.public void attributeDecl(java.lang.String elementName, java.lang.String attributeName, java.lang.String attributeType, java.lang.String[] options, java.lang.String defaultValue, boolean isFixed, boolean isRequired) throws SAXException
elementName
- The name of the element to which the attribute
applies; this includes a namespace prefix if one was used within
the DTD.attributeName
- The name of the attribute being declared; this
includes a namespace prefix if one was used within the DTD.attributeType
- The type of the attribute, either CDATA, NMTOKEN,
NMTOKENS, ENTITY, ENTITIES, NOTATION, ID, IDREF, or IDREFS as
defined in the XML specification; or null for enumerations.options
- When attributeType is null or NOTATION, this is an
array of the values which are permitted; it is otherwise null.defaultValue
- When not null, this provides the default value
of this attribute.isFixed
- When true, the defaultValue is the only legal value.
(Precludes isRequired.)isRequired
- When true, the attribute value must be provided
for each element of the named type. (Precludes isFixed.)public void endDtd() throws SAXException
startDtd(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |