java.lang.Object | |||
↳ | org.apache.xerces.parsers.XMLParser | ||
↳ | org.apache.xerces.parsers.AbstractXMLDocumentParser | ||
↳ | org.apache.xerces.parsers.AbstractSAXParser |
Known Direct Subclasses |
Known Indirect Subclasses |
This is the base class of all SAX parsers. It implements both the SAX1 and SAX2 parser functionality, while the actual pipeline is defined in the parser configuration.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractSAXParser.AttributesProxy | |||||||||||
AbstractSAXParser.LocatorProxy |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ALLOW_UE_AND_NOTATION_EVENTS | Feature identifier: allow notation and unparsed entity events to be sent out of order. | |||||||||
String | DECLARATION_HANDLER | Property id: declaration handler. | |||||||||
String | DOM_NODE | Property id: DOM node. | |||||||||
String | LEXICAL_HANDLER | Property id: lexical handler. | |||||||||
String | NAMESPACES | Feature identifier: namespaces. | |||||||||
String | STRING_INTERNING | Feature id: string interning. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.parsers.XMLParser
| |||||||||||
From interface
org.apache.xerces.xni.XMLDTDContentModelHandler
| |||||||||||
From interface
org.apache.xerces.xni.XMLDTDHandler
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fContentHandler | Content handler. | ||||||||||
fDTDHandler | DTD handler. | ||||||||||
fDeclHandler | Decl handler. | ||||||||||
fDeclaredAttrs | |||||||||||
fDocumentHandler | Document handler. | ||||||||||
fLexicalHandler | Lexical handler. | ||||||||||
fLexicalHandlerParameterEntities | Lexical handler parameter entities. | ||||||||||
fNamespaceContext | Namespace context | ||||||||||
fNamespacePrefixes | Namespace prefixes. | ||||||||||
fNamespaces | Namespaces. | ||||||||||
fParseInProgress | True if a parse is in progress. | ||||||||||
fQName | |||||||||||
fResolveDTDURIs | Resolve DTD URIs. | ||||||||||
fStandalone | Standalone document declaration. | ||||||||||
fUseEntityResolver2 | Use EntityResolver2. | ||||||||||
fVersion | |||||||||||
fXMLNSURIs | XMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.parsers.AbstractXMLDocumentParser
| |||||||||||
From class
org.apache.xerces.parsers.XMLParser
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
An attribute declaration.
| |||||||||||
Character content.
| |||||||||||
A comment.
| |||||||||||
Notifies of the presence of the DOCTYPE line in the document.
| |||||||||||
An element declaration.
| |||||||||||
The end of a CDATA section.
| |||||||||||
The end of the DTD.
| |||||||||||
The end of the document.
| |||||||||||
The end of an element.
| |||||||||||
The end of the DTD external subset.
| |||||||||||
This method notifies the end of an entity.
| |||||||||||
This method notifies the end of an entity.
| |||||||||||
An external entity declaration.
| |||||||||||
Provides
AttributePSVI given the index of an attribute
information item in the current element's attribute list. | |||||||||||
Provides
AttributePSVI given the namespace name and the
local name of an attribute information item in the current element's
attribute list. | |||||||||||
Return the current content handler.
| |||||||||||
Return the current DTD handler.
| |||||||||||
Provides the post schema validation item for the current element
information item.
| |||||||||||
Return the current entity resolver.
| |||||||||||
Return the current error handler.
| |||||||||||
Query the state of a feature.
| |||||||||||
Query the value of a property.
| |||||||||||
Ignorable whitespace.
| |||||||||||
An internal entity declaration.
| |||||||||||
A notation declaration
| |||||||||||
Parses the input source specified by the given system identifier.
| |||||||||||
parse
| |||||||||||
A processing instruction.
| |||||||||||
Reset all components before parsing.
| |||||||||||
Allow an application to register a content event handler.
| |||||||||||
Allow an application to register a DTD event handler.
| |||||||||||
Allow an application to register a document event handler.
| |||||||||||
Sets the resolver used to resolve external entities.
| |||||||||||
Allow an application to register an error event handler.
| |||||||||||
Set the state of any feature in a SAX2 parser.
| |||||||||||
Set the locale to use for messages.
| |||||||||||
Set the value of any property in a SAX2 parser.
| |||||||||||
The start of a CDATA section.
| |||||||||||
The start of the document.
| |||||||||||
The start of an element.
| |||||||||||
The start of the DTD external subset.
| |||||||||||
This method notifies of the start of an entity.
| |||||||||||
This method notifies of the start of parameter entity.
| |||||||||||
An unparsed entity declaration.
| |||||||||||
Notifies of the presence of an XMLDecl line in the document.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Send endPrefixMapping events
| |||||||||||
Returns the DTD declaration event handler.
| |||||||||||
Returns the lexical handler.
| |||||||||||
Set the DTD declaration event handler.
| |||||||||||
Set the lexical event handler.
| |||||||||||
Send startPrefixMapping events
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.parsers.AbstractXMLDocumentParser
| |||||||||||
From class
org.apache.xerces.parsers.XMLParser
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.xerces.xni.XMLDTDContentModelHandler
| |||||||||||
From interface
org.apache.xerces.xni.XMLDTDHandler
| |||||||||||
From interface
org.apache.xerces.xni.XMLDocumentHandler
| |||||||||||
From interface
org.apache.xerces.xs.PSVIProvider
| |||||||||||
From interface
org.xml.sax.Parser
| |||||||||||
From interface
org.xml.sax.XMLReader
|
Feature identifier: allow notation and unparsed entity events to be sent out of order.
Property id: declaration handler.
Property id: DOM node.
Property id: lexical handler.
Feature identifier: namespaces.
Feature id: string interning.
Content handler.
DTD handler.
Decl handler.
Document handler.
Lexical handler.
Lexical handler parameter entities.
Namespace prefixes.
Namespaces.
True if a parse is in progress. This state is needed because some features/properties cannot be set while parsing (e.g. validation and namespaces).
Resolve DTD URIs.
Standalone document declaration.
Use EntityResolver2.
XMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace.
An attribute declaration.
elementName | The name of the element that this attribute is associated with. |
---|---|
attributeName | The name of the attribute. |
type | The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION". |
enumeration | If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null. |
defaultType | The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null. |
defaultValue | The attribute default value, or null if no default value is specified. |
nonNormalizedDefaultValue | The attribute default value with no normalization performed, or null if no default value is specified. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
Character content.
text | The content. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
A comment.
text | The text in the comment. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by application to signal an error. |
---|
Notifies of the presence of the DOCTYPE line in the document.
rootElement | The name of the root element. |
---|---|
publicId | The public identifier if an external DTD or null if the external DTD is specified using SYSTEM. |
systemId | The system identifier if an external DTD, null otherwise. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
An element declaration.
name | The name of the element. |
---|---|
contentModel | The element content model. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
The end of a CDATA section.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The end of the DTD.
augs | Additional information that may include infoset augmentations. |
---|
XNIException | Thrown by handler to signal an error. |
---|
The end of the document.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The end of an element.
element | The name of the element. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
The end of the DTD external subset.
augs | Additional information that may include infoset augmentations. |
---|
XNIException | Thrown by handler to signal an error. |
---|
This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.
Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the entity. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.
Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the parameter entity. |
---|---|
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
An external entity declaration.
name | The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name. |
---|---|
identifier | An object containing all location information pertinent to this entity. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
Provides AttributePSVI
given the index of an attribute
information item in the current element's attribute list. The method
must be called by an application while in the scope of the methods
which report the start and end of an element at a point where the
attribute list is available. For example, for SAX the method must be
called while in the scope of the document handler's
startElement
call. If the method is called outside of
the specified scope, the return value is undefined.
index | The attribute index. |
---|
Provides AttributePSVI
given the namespace name and the
local name of an attribute information item in the current element's
attribute list. The method must be called by an application while in
the scope of the methods which report the start and end of an element
at a point where the attribute list is available. For example, for
SAX the method must be called while in the scope of the document
handler's startElement
call. If the method is called
outside of the specified scope, the return value is undefined.
uri | The namespace name of an attribute. |
---|---|
localname | The local name of an attribute. |
Return the current content handler.
Return the current DTD handler.
Provides the post schema validation item for the current element
information item. The method must be called by an application while
in the scope of the methods which report the start and end of an
element. For example, for SAX the method must be called within the
scope of the document handler's startElement
or
endElement
call. If the method is called outside of the
specified scope, the return value is undefined.
Return the current entity resolver.
Return the current error handler.
Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.
featureId | The unique identifier (URI) of the feature being set. |
---|
SAXNotRecognizedException | If the requested feature is not known. |
---|---|
SAXNotSupportedException | If the requested feature is known but not supported. |
Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.
propertyId | The unique identifier (URI) of the property being set. |
---|
SAXNotRecognizedException | If the requested property is not known. |
---|---|
SAXNotSupportedException | If the requested property is known but not supported. |
Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
text | The ignorable whitespace. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
An internal entity declaration.
name | The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name. |
---|---|
text | The value of the entity. |
nonNormalizedText | 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. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
A notation declaration
name | The name of the notation. |
---|---|
identifier | An object containing all location information pertinent to this notation. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
Parses the input source specified by the given system identifier.
This method is equivalent to the following:
parse(new InputSource(systemId));
systemId | The system identifier (URI). |
---|
SAXException | Throws exception on SAX error. |
---|---|
IOException | Throws exception on i/o error. |
parse
org.xml.sax.SAXException | |
IOException | |
SAXException |
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.
target | The target. |
---|---|
data | The data or null if none specified. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Reset all components before parsing.
XNIException | Thrown if an error occurs during initialization. |
---|
Allow an application to register a content event handler.
If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
contentHandler | The content handler. |
---|
Allow an application to register a DTD event handler.
If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
dtdHandler | The DTD handler. |
---|
Allow an application to register a document event handler.
If the application does not register a document handler, all document events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by HandlerBase).
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
documentHandler | The document handler. |
---|
Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.
resolver | The new entity resolver. Passing a null value will uninstall the currently installed resolver. |
---|
Allow an application to register an error event handler.
If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
errorHandler | The error handler. |
---|
Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
featureId | The unique identifier (URI) of the feature. |
---|---|
state | The requested state of the feature (true or false). |
SAXNotRecognizedException | If the requested feature is not known. |
---|---|
SAXNotSupportedException | If the requested feature is known, but the requested state is not supported. |
Set the locale to use for messages.
locale | The locale object to use for localization of messages. |
---|
SAXException | An exception thrown if the parser does not support the specified locale. |
---|
Set the value of any property in a SAX2 parser. The parser might not recognize the property, and if it does recognize it, it might not support the requested value.
propertyId | The unique identifier (URI) of the property being set. |
---|---|
value | The value to which the property is being set. |
SAXNotRecognizedException | If the requested property is not known. |
---|---|
SAXNotSupportedException | If the requested property is known, but the requested value is not supported. |
The start of a CDATA section.
augs | Additional information that may include infoset augmentations |
---|
XNIException | Thrown by handler to signal an error. |
---|
The start of the document.
locator | The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document. |
---|---|
encoding | 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 entities or a document entity that is parsed from a java.io.Reader). |
namespaceContext | The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods.
element | The name of the element. |
---|---|
attributes | The element attributes. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
The start of the DTD external subset.
identifier | The resource identifier. |
---|---|
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
This method notifies of the start of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.
Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the entity. |
---|---|
identifier | The resource identifier. |
encoding | 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). |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
This method notifies of the start of parameter entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.
Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.
Note: This method is not called for entity references appearing as part of attribute values.
name | The name of the parameter entity. |
---|---|
identifier | The resource identifier. |
encoding | 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). |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
An unparsed entity declaration.
name | The name of the entity. |
---|---|
identifier | An object containing all location information pertinent to this entity. |
notation | The name of the notation. |
augs | Additional information that may include infoset augmentations. |
XNIException | Thrown by handler to signal an error. |
---|
Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.
version | The XML version. |
---|---|
encoding | The IANA encoding name of the document, or null if not specified. |
standalone | The standalone value, or null if not specified. |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Send endPrefixMapping events
SAXException |
---|
Returns the DTD declaration event handler.
SAXNotRecognizedException | |
---|---|
SAXNotSupportedException |
Returns the lexical handler.
SAXNotRecognizedException | |
---|---|
SAXNotSupportedException |
Set the DTD declaration event handler.
This method is the equivalent to the property:
http://xml.org/sax/properties/declaration-handler
handler | The new handler. |
---|
SAXNotRecognizedException | |
---|---|
SAXNotSupportedException |
Set the lexical event handler.
This method is the equivalent to the property:
http://xml.org/sax/properties/lexical-handler
handler | lexical event handler |
---|
SAXNotRecognizedException | |
---|---|
SAXNotSupportedException |
Send startPrefixMapping events
SAXException |
---|