Method
Description
void attlistDecl(int elementTypeIndex,
Serves as a callback for attribute int attrNameIndex, int attType,
java.lang.
declarationsString enumString, int attDefaultType, int
attDefaultValue)
void characters(int
dataIndex)
Serves as a callback for characters
void comment(int
dataIndex)
Serves as a callback for comments
void elementDecl(int elementTypeIndex,
Serves as a callback for element XMLValidator.ContentSpec
contentSpec)
declarations
void
endCDATA()
‑Serves as a callback for the end of CDATA section
void
endDocument()
‑Serves as a callback for the end of the document
void
endDTD()
Is called at the end of the DTD
void endElement(int
elementTypeIndex)
‑Serves as a callback for the end of elements
Method
Description
void endEntityReference(int entityName,
Serves as a callback for the end of int entityType, int
entityContext)
entity references
void endNamespaceDeclScope(int
prefix)
‑Serves as a callback for the end of the scope of a namespace
declaration
void externalEntityDecl(int entityNameIndex,
Serves as a callback for external entityint publicIdIndex, int
systemIdIndex) references
void externalPEDecl(int entityName, int
Serves as a callback for external publicId, int
systemId)
parameter entities declarations
boolean
getCreateEntityReferenceNodes()
‑Is true if entity references in the document are included in
the document as EntityReference nodes
protected Element
getCurrentElementNode()
Returns the current element node
protected boolean
getDeferNodeExpansion()
‑Is true if the expansion of nodes is deferred
Document
getDocument()
Returns the document itself
protected java.lang.String
Returns the qualified class name of
thegetDocumentClassName()
document factory
boolean getFeature(java.lang.String
featureId)
‑Gets the current state of any feature in a SAX2 parser
java.lang.String[]
getFeaturesRecognized()
‑Gets a list of features that this parser recognizes
boolean
getIncludeIgnorableWhitespace()
‑Is true if there are ignorable whitespace text nodes in the
DOM tree
java.lang.String[]
getPropertiesRecognized()
‑Gets a list of properties that the parser recognizes
java.lang.Object
getProperty(java.lang.
Gets the value of a property in a SAX2String
propertyId)
parser
void ignorableWhitespace(int
dataIndex)
‑Serves as a callback for ignorable whitespace
protected void
init()
‑Initializes or reinitializes the parser to a pre-parse
state
void internalEntityDecl(int entityNameIndex,
Serves as a callback for an internal int
entityValueIndex)
entity declaration
void internalPEDecl(int entityName,
Serves as a callback for an internal int
entityValue)
parameter entity declaration
void internalSubset(int
internalSubset)
‑Supports DOM Level 2 internalSubsets
void notationDecl(int notationNameIndex,
Serves as a callback for notation int publicIdIndex, int
systemIdIndex)
declarations
void processingInstruction(int
Serves as a callback for processingtargetIndex, int
dataIndex)
instructions
void
reset()
Resets the parser
void
resetOrCopy()
Resets or copies the parser
protected void
setCreateEntity
Indicates whether entity references in ReferenceNodes(boolean
create)
‑the document are part of the document as EntityReference
nodes
protected void
setDeferNodeExpansion
Indicates whether the expansion of the (boolean
deferNodeExpansion)
nodes is deferred
protected void
setDocumentClassName
Lets you decide which document (java.lang.String
documentClassName)
factory to use
void setFeature(java.lang.String featureId,
Sets the state of any feature in a SAX2boolean
state)
parser
void
setIncludeIgnorableWhitespace
Specifies whether ignorable whitespace(boolean
include)
text nodes are included in the DOM
tree
void setProperty(java.lang.String
Sets the value of any property in apropertyId, java.lang.Object
value)
SAX2 parser
void
startCDATA()
‑Serves as a callback for the start of a CDATA section
void startDocument(int versionIndex,
Serves as a callback for the start of a int encodingIndex, int
standAloneIndex) document
void startDTD(int rootElementType, int
Serves as a callback for the start of a publicId, int
systemId)
DTD
void startElement(int elementTypeIndex,
Serves as a callback for the start of an XMLAttrList xmlAttrList, int
attrListIndex)element
void startEntityReference(int entityName,
Serves as a callback for the start of an int entityType, int
entityContext)
entity reference
void
startNamespaceDeclScope
Serves as a callback for the start of the(int prefix, int
uri)
scope of a namespace declaration
void unparsedEntityDecl(int entityNameIndex,
Serves as a callback for an unparsed int publicIdIndex, int
systemIdIndex,
entity declarationint notationNameIndex)
The DOMParser class is based on the XMLParser class, and the
XMLParser class has a great deal of functionality that you frequently
use in XML for Java programming. The XMLParser constructor is
protectedXMLParser(). The methods of the XMLParser class are listed
in Table 11.2.