com.sun.xml.parser
Interface DtdEventListener


public abstract interface DtdEventListener
extends DTDHandler

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.

See Also:
Parser

Method Summary
 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

startDtd

public void startDtd(java.lang.String rootName)
              throws SAXException
Receive notification of the beginning of a Document Type Declaration (DTD). The parser will invoke this method only once, before any other methods in this interface.
Parameters:
rootName - The declared name of the root element, which may be different from the actual name if the document is not valid.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endDtd()

externalDtdDecl

public void externalDtdDecl(java.lang.String publicId,
                            java.lang.String systemId)
                     throws SAXException
Reports the optional unnamed parameter entity which is processed after the internal DTD subset. This commonly provides the entire external DTD subset, in case where the internal DTD subset does not define and use external parameter entities. The parser will invoke this method at most once.
Parameters:
publicId - The entity's public identifier, or null if none was given.
systemId - The entity's system identifier.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
internalDtdDecl(java.lang.String)

internalDtdDecl

public void internalDtdDecl(java.lang.String internalSubset)
                     throws SAXException
Reports the internal DTD subset, as unparsed markup declarations. This may also contain comments and processing instructions, if they are found in the document source. Applications should treat this string as opaque, only using it when recreating a <!DOCTYPE ...> declaration. The parser will invoke this method at most once.
Parameters:
internalSubset - The document's internal subset, as unparsed markup declarations, comments, and processing instructions.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
externalDtdDecl(java.lang.String, java.lang.String)

internalEntityDecl

public void internalEntityDecl(java.lang.String name,
                               java.lang.String value)
                        throws SAXException
Receive notification of a internal parsed entity declaration event.
Parameters:
name - The internal entity name.
value - the value of the entity, which may include unexpanded entity references. Character references will have been expanded.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

externalEntityDecl

public void externalEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId)
                        throws SAXException
Receive notification of an external parsed entity declaration event.

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.

Parameters:
name - The entity name.
publicId - The entity's public identifier, or null if none was given.
systemId - The entity's system identifier.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

endDtd

public void endDtd()
            throws SAXException
Receive notification of the end of a DTD. The parser will invoke this method only once.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
startDtd(java.lang.String)


Submit Feedback to xml-feedback@java.sun.com
Copyright © 1998-1999 Sun Microsystems, Inc. All Rights Reserved.

Sun Microsystems, Inc.
901 San Antonio Road
Palo Alto, California, 94303, U.S.A.