DTDHandler
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
|
Receive notification of basic DTD-related events.
This module, both source code and documentation, is in the
Public Domain, and comes with NO WARRANTY.
See http://www.saxproject.org
for further information.
If a SAX application needs information about notations and
unparsed entities, then the application implements this
interface and registers an instance with the SAX parser using
the parser's setDTDHandler method. The parser uses the
instance to report notation and unparsed entity declarations to
the application.
Note that this interface includes only those DTD events that
the XML recommendation requires processors to report:
notation and unparsed entity declarations.
The SAX parser may report these events in any order, regardless
of the order in which the notations and unparsed entities were
declared; however, all DTD events must be reported after the
document handler's startDocument event, and before the first
startElement event.
(If the LexicalHandler
is
used, these events must also be reported before the endDTD event.)
It is up to the application to store the information for
future use (perhaps in a hash table or object tree).
If the application encounters attributes of type "NOTATION",
"ENTITY", or "ENTITIES", it can use the information that it
obtained through this interface to find the entity and/or
notation corresponding with the attribute value.
Public Method Summary
abstract
void
|
|
abstract
void
|
|
Public Methods
public
abstract
void
notationDecl
(String name, String publicId, String systemId)
Receive notification of a notation declaration event.
It is up to the application to record the notation for later
reference, if necessary;
notations may appear as attribute values and in unparsed entity
declarations, and are sometime used with processing instruction
target names.
At least one of publicId and systemId must be non-null.
If a system identifier is present, and it is a URL, the SAX
parser must resolve it fully before passing it to the
application through this event.
There is no guarantee that the notation declaration will be
reported before any unparsed entities that use it.
Parameters
name |
The notation name. |
publicId |
The notation's public identifier, or null if
none was given. |
systemId |
The notation's system identifier, or null if
none was given. |
Throws
SAXException |
Any SAX exception, possibly
wrapping another exception. |
public
abstract
void
unparsedEntityDecl
(String name, String publicId, String systemId, String notationName)
Receive notification of an unparsed entity declaration event.
Note that the notation name corresponds to a notation
reported by the notationDecl
event.
It is up to the application to record the entity for later
reference, if necessary;
unparsed entities may appear as attribute values.
If the system identifier is a URL, the parser must resolve it
fully before passing it to the application.
Parameters
name |
The unparsed entity's name. |
publicId |
The entity's public identifier, or null if none
was given. |
systemId |
The entity's system identifier. |
notationName |
The name of the associated notation. |
Throws
SAXException |
Any SAX exception, possibly
wrapping another exception. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDTDHandler\u003c/code\u003e interface receives notification of basic DTD-related events like notation and unparsed entity declarations for SAX applications.\u003c/p\u003e\n"],["\u003cp\u003eSAX parsers use this interface to inform applications about notations and unparsed entities, which can be stored for later use.\u003c/p\u003e\n"],["\u003cp\u003eApplications implement this interface and register it with the parser to handle DTD events, enabling them to access and utilize information about notations and unparsed entities.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enotationDecl\u003c/code\u003e method provides information about notation declarations, including the notation name, public identifier, and system identifier.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eunparsedEntityDecl\u003c/code\u003e method provides information about unparsed entity declarations, including the entity name, public identifier, system identifier, and associated notation name.\u003c/p\u003e\n"]]],[],null,["public interface **DTDHandler** \n\n|---|---|---|\n| Known Indirect Subclasses [DefaultHandler](../../../../reference/org/xml/sax/helpers/DefaultHandler.html), [DefaultHandler2](../../../../reference/org/xml/sax/ext/DefaultHandler2.html), [HandlerBase](../../../../reference/org/xml/sax/HandlerBase.html), [TransformerHandler](../../../../reference/javax/xml/transform/sax/TransformerHandler.html), [XMLFilterImpl](../../../../reference/org/xml/sax/helpers/XMLFilterImpl.html) |---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [DefaultHandler](../../../../reference/org/xml/sax/helpers/DefaultHandler.html) | Default base class for SAX2 event handlers. | | [DefaultHandler2](../../../../reference/org/xml/sax/ext/DefaultHandler2.html) | This class extends the SAX2 base handler class to support the SAX2 [LexicalHandler](../../../../reference/org/xml/sax/ext/LexicalHandler.html), [DeclHandler](../../../../reference/org/xml/sax/ext/DeclHandler.html), and [EntityResolver2](../../../../reference/org/xml/sax/ext/EntityResolver2.html) extensions. | | [HandlerBase](../../../../reference/org/xml/sax/HandlerBase.html) | *This class is deprecated. This class works with the deprecated [DocumentHandler](../../../../reference/org/xml/sax/DocumentHandler.html) interface. It has been replaced by the SAX2 [DefaultHandler](../../../../reference/org/xml/sax/helpers/DefaultHandler.html) class.* | | [TransformerHandler](../../../../reference/javax/xml/transform/sax/TransformerHandler.html) | A TransformerHandler listens for SAX ContentHandler parse events and transforms them to a Result. | | [XMLFilterImpl](../../../../reference/org/xml/sax/helpers/XMLFilterImpl.html) | Base class for deriving an XML filter. | |||\n\nReceive notification of basic DTD-related events.\n\n\u003e *This module, both source code and documentation, is in the\n\u003e Public Domain, and comes with **NO WARRANTY**.* See \u003chttp://www.saxproject.org\u003e for further information.\n\nIf a SAX application needs information about notations and\nunparsed entities, then the application implements this\ninterface and registers an instance with the SAX parser using\nthe parser's setDTDHandler method. The parser uses the\ninstance to report notation and unparsed entity declarations to\nthe application.\n\nNote that this interface includes only those DTD events that\nthe XML recommendation *requires* processors to report:\nnotation and unparsed entity declarations.\n\nThe SAX parser may report these events in any order, regardless\nof the order in which the notations and unparsed entities were\ndeclared; however, all DTD events must be reported after the\ndocument handler's startDocument event, and before the first\nstartElement event.\n(If the [LexicalHandler](../../../../reference/org/xml/sax/ext/LexicalHandler.html) is\nused, these events must also be reported before the endDTD event.)\n\nIt is up to the application to store the information for\nfuture use (perhaps in a hash table or object tree).\nIf the application encounters attributes of type \"NOTATION\",\n\"ENTITY\", or \"ENTITIES\", it can use the information that it\nobtained through this interface to find the entity and/or\nnotation corresponding with the attribute value.\n\n\u003cbr /\u003e\n\nSee Also\n\n- [XMLReader.setDTDHandler(DTDHandler)](../../../../reference/org/xml/sax/XMLReader.html#setDTDHandler(org.xml.sax.DTDHandler)) \n\nPublic Method Summary\n\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [notationDecl](../../../../reference/org/xml/sax/DTDHandler.html#notationDecl(java.lang.String,%20java.lang.String,%20java.lang.String))([String](../../../../reference/java/lang/String.html) name, [String](../../../../reference/java/lang/String.html) publicId, [String](../../../../reference/java/lang/String.html) systemId) Receive notification of a notation declaration event. |\n| abstract void | [unparsedEntityDecl](../../../../reference/org/xml/sax/DTDHandler.html#unparsedEntityDecl(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))([String](../../../../reference/java/lang/String.html) name, [String](../../../../reference/java/lang/String.html) publicId, [String](../../../../reference/java/lang/String.html) systemId, [String](../../../../reference/java/lang/String.html) notationName) Receive notification of an unparsed entity declaration event. |\n\nPublic Methods \n\npublic abstract void\n**notationDecl**\n([String](../../../../reference/java/lang/String.html) name, [String](../../../../reference/java/lang/String.html) publicId, [String](../../../../reference/java/lang/String.html) systemId) \nReceive notification of a notation declaration event.\n\nIt is up to the application to record the notation for later\nreference, if necessary;\nnotations may appear as attribute values and in unparsed entity\ndeclarations, and are sometime used with processing instruction\ntarget names.\n\nAt least one of publicId and systemId must be non-null.\nIf a system identifier is present, and it is a URL, the SAX\nparser must resolve it fully before passing it to the\napplication through this event.\n\nThere is no guarantee that the notation declaration will be\nreported before any unparsed entities that use it.\n\n\u003cbr /\u003e\n\nParameters\n\n| name | The notation name. |\n| publicId | The notation's public identifier, or null if none was given. |\n| systemId | The notation's system identifier, or null if none was given. |\n|----------|--------------------------------------------------------------|\n\nThrows\n\n| [SAXException](../../../../reference/org/xml/sax/SAXException.html) | Any SAX exception, possibly wrapping another exception. |\n|---------------------------------------------------------------------|---------------------------------------------------------|\n\nSee Also\n\n- [unparsedEntityDecl(String, String, String, String)](../../../../reference/org/xml/sax/DTDHandler.html#unparsedEntityDecl(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))\n- [Attributes](../../../../reference/org/xml/sax/Attributes.html) \n\npublic abstract void\n**unparsedEntityDecl**\n([String](../../../../reference/java/lang/String.html) name, [String](../../../../reference/java/lang/String.html) publicId, [String](../../../../reference/java/lang/String.html) systemId, [String](../../../../reference/java/lang/String.html) notationName) \nReceive notification of an unparsed entity declaration event.\n\nNote that the notation name corresponds to a notation\nreported by the [notationDecl](../../../../reference/org/xml/sax/DTDHandler.html#notationDecl(java.lang.String,%20java.lang.String,%20java.lang.String)) event.\nIt is up to the application to record the entity for later\nreference, if necessary;\nunparsed entities may appear as attribute values.\n\nIf the system identifier is a URL, the parser must resolve it\nfully before passing it to the application.\n\n\u003cbr /\u003e\n\nParameters\n\n| name | The unparsed entity's name. |\n| publicId | The entity's public identifier, or null if none was given. |\n| systemId | The entity's system identifier. |\n| notationName | The name of the associated notation. |\n|--------------|------------------------------------------------------------|\n\nThrows\n\n| [SAXException](../../../../reference/org/xml/sax/SAXException.html) | Any SAX exception, possibly wrapping another exception. |\n|---------------------------------------------------------------------|---------------------------------------------------------|\n\nSee Also\n\n- [notationDecl(String, String, String)](../../../../reference/org/xml/sax/DTDHandler.html#notationDecl(java.lang.String,%20java.lang.String,%20java.lang.String))\n- [Attributes](../../../../reference/org/xml/sax/Attributes.html)"]]