org.openxml.parser
Class BaseParser

java.lang.Object
  |
  +--org.openxml.parser.BaseParser
Direct Known Subclasses:
org.openxml.parser.ContentParser, DTDParser

public abstract class BaseParser
extends java.lang.Object
implements org.openxml.io.Parser, Locator

Implements layer 0, layer 1 and some layer 2 parsing methods, in addition to error reportingand logging, and mode access.

Layer 0 methods

Layer 0 methods perform low-level reading from the input stream. They support line numbering, line terminator consolidation, and an unlimited pushback buffer. Characters are read sequentially with readChar(), and pushed back to be re-read with pushBack(). The last character read and the next character to be pushed back are contained in the variable _curChar. The value EOF indicates that the end of the input stream.

The method setEncoding(java.lang.String) can be used to change the character encoding mid-stream, but is effective only in the input stream is of type XMLStreamReader. The method close() closes the parser once all input has been parsed and isClosed() returns true afterwards.

Layer 1 methods

Layer 1 methods perform token reading from the input stream. The token code is returned and the token value is contained in _tokenText. The value in _tokenText is replaced each time one of these methods is called.

readTokenMarkup() reads and returns the markup token that follows the '<' sign; the '<' has already been consumed. readTokenEntity() reads and returns the general entity reference or character reference that follows the '&' sign; the '&' has already been consumed. readTokenPERef() reads and returns the parameter entity reference that follows the '%' sign; the '%' sign has already been consumed. If a valid token is not recognized, the sign ('<', '&' or '%') is returned as the token code TOKEN_TEXT.

The method readTokenName() reads and returns a valid token name. The characters that consitute a valid token name are defined by isNamePart(int, boolean). The method canReadName(java.lang.String) attempts to read and consume the specified name.

In addition the following convenience methods are defined: isSpace(int) identifies a whitespace character; isTokenAllSpace() returns true if a token is all whitespace characters; slicePITokenText() slices a processing instruction into target name and instruction; readTokenQuoted() reads a quoted (single or double) string and returns it as token text.

Layer 2 methods

Several layer 2 methods that are common to ContentParser and DTDParser are also defined. parseGeneralEntity(org.openxml.dom.EntityImpl) parses a general entity using an new parser instance. parseDocumentDecl(boolean) parses the document declaration found in both XML documents, external subsets and external entities.

Error reporting methods

The method getLastException() returns the last exception issued. Expections are stored in a LIFO order and can be retrieved by calling SAXException#getPrevious recursively on each exception.

An error is issued by calling one of the error(int, java.lang.String) methods, either storing the exception or throwing a SAXException, depending on the severity level.

The error methods are defined as an ErrorSinkHandler interface, allowing the definition of an external error sink. Typically the document parser serves as an error sink for entity parsers (see setErrorSink(org.openxml.parser.ErrorSinkHandler)).

Mode methods

The method isMode(short) identifies which processing mode is in effect. The processing mode is controlled by the constructor.

Version:
$Revision: 1.11 $ $Date: 1999/04/18 01:52:12 $
Author:
Assaf Arkin
See Also:
Parser, SAXException, XMLStreamReader

Field Summary
protected  int _curChar
          Holds the last character read by readChar(), or the next character to be pushed back (see pushBack()).
protected  Document _document
          The XML/HTML/DTD document being processed.
protected  org.openxml.util.FastString _tokenText
          Holds the contents of the last token read by one of the token reading methods.
protected static char CR
          Carriage return.
protected static int EOF
          Indicates that end of file (or the input stream) has been reached and no more character are availble.
protected static char LF
          Line feed.
protected static char SPACE
          Space.
protected static short TOKEN_CDATA
          CDATA section token.
protected static short TOKEN_CLOSE_TAG
          Close tag token.
protected static short TOKEN_COMMENT
          Comment token.
protected static short TOKEN_DTD
          DTD token.
protected static short TOKEN_ENTITY_REF
          Entity reference token.
protected static short TOKEN_EOF
          End of input.
protected static short TOKEN_OPEN_TAG
          Open tag token.
protected static short TOKEN_PE_REF
          Parameter entity reference.
protected static short TOKEN_PI
          Processing instruction token.
protected static short TOKEN_SECTION
          DTD section token.
protected static short TOKEN_SECTION_END
          DTD section token end.
protected static short TOKEN_TEXT
          Textual token.
 
Constructor Summary
protected BaseParser(java.io.Reader reader, java.lang.String sourceURI, short mode, short stopAtSeverity)
          Parser constructor.
 
Method Summary
protected  void advanceLineNumber(int increment)
          Advances the line number count by the specified increment.
protected  boolean canReadName(java.lang.String name)
          Returns true if the specified name can be read and consumes it all.
protected  void close()
          Closes the input stream.
 void error(int errorLevel, java.lang.String message)
           
 void fatalError(java.lang.Exception except)
           
 int getColumnNumber()
           
 ErrorHandler getErrorHandler()
          Returns the error handler associated with this parser (if any).
 ErrorReport getErrorReport()
          Returns the error report facility associated with this parser (if any).
 SAXParseException getLastException()
          Error reporting and logging, and source location methods
 int getLineNumber()
           
 Locator getLocator()
           
protected  short getMode()
          Returns the current parsing mode.
 java.lang.String getPublicId()
           
protected  java.io.Reader getReader()
          Returns the reader used for accessing the underlying input stream.
 int getSourcePosition()
           
 java.lang.String getSourceURI()
          Deprecated. Use getSystemId() instead.
 java.lang.String getSystemId()
           
protected  boolean isClosed()
          Returns true if the document has been fully parsed and the parsed has been closed.
protected  boolean isMode(short mode)
          Returns true if the specified parsing mode is in effect.
protected  boolean isNamePart(int ch, boolean first)
          Returns true if character is part of a valid name.
protected  boolean isSpace(int ch)
          Returns true if character is a whitespace.
protected  boolean isTokenAllSpace()
          Returns true if the token is all whitespace.
protected  boolean parseDocumentDecl(boolean XMLDecl)
          Parses the document declaration for XML documents and external entities, returning the standalone status and changing the character encoding (if necessary).
protected  org.openxml.dom.EntityImpl parseGeneralEntity(org.openxml.dom.EntityImpl entity)
          Parses the general entity, returning the entity as parsed.
protected  void pushBack()
          Push back the last character read into _curChar.
protected  void pushBack(int ch)
          Push back a single character.
protected  int readChar()
          Reads and returns a single character from the input stream.
protected  int readTokenEntity()
          Reads general entity reference token or character reference.
protected  int readTokenMarkup()
          Reads markup token.
protected  boolean readTokenName()
          Reads a valid token name and places it in _tokenText.
protected  int readTokenPERef()
          Reads parameter entity reference token.
protected  boolean readTokenQuoted()
          Reads the quoted identifier token.
protected  void setEncoding(java.lang.String encoding)
          Changes the encoding of the input stream.
 void setErrorHandler(ErrorHandler handler)
          Associates this parser with an error handler.
 void setErrorSink(ErrorSinkHandler errorSink)
          Deprecated. Use setErrorHandler(org.xml.sax.ErrorHandler) instead
protected  java.lang.String slicePITokenText()
          Slices processing instruction text into target and instruction code.
 void warning(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOF

protected static final int EOF
Indicates that end of file (or the input stream) has been reached and no more character are availble. This character is invalid. It is legal to push is back, though.

LF

protected static final char LF
Line feed. Character code 0x0A.

CR

protected static final char CR
Carriage return. Character code 0x0D.

SPACE

protected static final char SPACE
Space. Character code 0x20.

TOKEN_EOF

protected static final short TOKEN_EOF
End of input. This token indicates that the end of the input stream (for this entity) has been reached. Reading past this token will always return this token.

TOKEN_TEXT

protected static final short TOKEN_TEXT
Textual token. _tokenText contains the plain text. This token is generally used to construct a Text node when appearing in the content.

TOKEN_ENTITY_REF

protected static final short TOKEN_ENTITY_REF
Entity reference token. _tokenText contains the entity name. This token is generally used to construct a EntityReference node.

TOKEN_OPEN_TAG

protected static final short TOKEN_OPEN_TAG
Open tag token. _tokenText contains the tag name. This token is generally used to construct a Element node. Only the tag name is read, the attributes and terminating '>' should be read separately (see ContentParser.parseAttributes(org.w3c.dom.Element, boolean)).

TOKEN_CLOSE_TAG

protected static final short TOKEN_CLOSE_TAG
Close tag token. _tokenText contains the tag name. This token is generally used to construct a Element node. The entire closing tag has been consumed.

TOKEN_COMMENT

protected static final short TOKEN_COMMENT
Comment token. _tokenText contains the comment text (if in mode Parser.MODE_STORE_COMMENT). This token is generally used to construct a Comment node.

TOKEN_PI

protected static final short TOKEN_PI
Processing instruction token. _tokenText contains the processing instruction (if in mode Parser.MODE_STORE_PI). This token is generally used to construct a ProcessingInstruction node.

TOKEN_CDATA

protected static final short TOKEN_CDATA
CDATA section token. _tokenText contains the CDATA contents. This token is generally used to construct a CDATASection node.

TOKEN_DTD

protected static final short TOKEN_DTD
DTD token. _tokenText contains the DTD entity type (whatever comes after '

TOKEN_SECTION

protected static final short TOKEN_SECTION
DTD section token. Indicates a 'TOKEN_CDATA would have been returned. This token is valid only in the external DTD subset.

TOKEN_SECTION_END

protected static final short TOKEN_SECTION_END
DTD section token end. Indicates a ']]>' that terminates an 'INCLUDE' or 'IGNORE' section. The 'CDATA' terminator is always consumed for the TOKEN_CDATA token. This token is valid only in the external DTD.

TOKEN_PE_REF

protected static final short TOKEN_PE_REF
Parameter entity reference. _tokenText contains the entity name. This token is valid only in the DTD.

_curChar

protected int _curChar
Holds the last character read by readChar(), or the next character to be pushed back (see pushBack()). Set to EOF if end of input stream has been reached.
See Also:
readChar()

_tokenText

protected org.openxml.util.FastString _tokenText
Holds the contents of the last token read by one of the token reading methods. Set to TOKEN_EOF if end of input stream has been reached. Many methods read, modify and possibly return values in _tokenText, so its value should not be assumed to remain constant between method calls.

A StringBuffer is allocated and constantly reused by resetting its length to zero. In some instances, it is replaced with an alternative StringBuffer object. IT IS IMPORTANT that no other variable will reference this StringBuffer.

See Also:
ContentParser.readTokenContent()

_document

protected Document _document
The XML/HTML/DTD document being processed. When parsing an entity, this variable points to the document to which the entity belongs.
Constructor Detail

BaseParser

protected BaseParser(java.io.Reader reader,
                     java.lang.String sourceURI,
                     short mode,
                     short stopAtSeverity)
Parser constructor. Requires source text in the form of a Reader object and textual identifier. The parsing mode consists of a combination of MODE_.. flags. The constructor specifies the error severity level at which to stop parsing, either Parser.STOP_SEVERITY_FATAL, Parser.STOP_SEVERITY_VALIDITY or Parser.STOP_SEVERITY_WELL_FORMED.
Parameters:
reader - Any Reader from which entity text can be read
sourceURI - URI of entity source
mode - The parsing mode in effect
stopAtSeverity - Severity level at which to stop parsing
Method Detail

parseGeneralEntity

protected final org.openxml.dom.EntityImpl parseGeneralEntity(org.openxml.dom.EntityImpl entity)
                                                       throws SAXException
Parses the general entity, returning the entity as parsed. An existing EntityImpl is passed to the method. On exit, the same entity (parsed) is returned, or null to indicate that the entity could not be parsed.

The following rules govern how the entity is parsed:

  • If the entity's state is EntityImpl.STATE_PARSED, then the entity has been parsed before, and is returned.
  • If the entity's state is EntityImpl.STATE_NOT_FOUND, then the entity could not be found, and null is returned. There is no need to issue an error again.
  • If the entity's state is EntityImpl.STATE_PARSING, then the entity is being parsed: this is a circular reference, an error is issued and null is returned.
  • If the entity's state is EntityImpl.STATE_DECLARED, then the entity is being parsed. For an external entity, the entity source is being located using HolderFinder. If the entity source could not be found or could not be opened, the entity state is set to EntityImpl.STATE_NOT_FOUND, an error is issued and null returned. For an internal entity, the entity source is created from it's value.
  • If the entity's state is EntityImpl.STATE_DECLARED and the entity source could be located, an XMLParser is created and used to parse the entity. If no fatal errors are encountered when parsing, the entity is returned. Well formed errors are treated as if generated by the current parser.
  • If the entity's state is EntityImpl.STATE_DECLARED and a fatal error was issued while parsing the entity with an XMLParser, then a fatal error is issued and an exception raised.
Well formed and validity errors issued by the external entity parser are reported directly to this parser and treated by the error mode of this entity. Fatal and I/O exceptions will terminate parsing with a fatal error.
Parameters:
entity - The entity to parse
Returns:
The entity if parsed, null if could not be parsed
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing

parseDocumentDecl

protected final boolean parseDocumentDecl(boolean XMLDecl)
                                   throws SAXException
Parses the document declaration for XML documents and external entities, returning the standalone status and changing the character encoding (if necessary). Errors are issued if the document declaration is invalid.

The document declaration is contained in a processing instruction that appears at the very beginning of the document or entity and begins with 'xml' (case sensitive). The processing instruction's full text is expected in the variable _tokenText on entry.

The declaration for XML documents contains a version number, optional character encoding and optional standalone status. The default standalone status is false. The declaration for external entities and external subsets contains an optional version number, and mandatory character encoding.

Currently only XML version "1.0" is supported. The current character encoding is changed by calling setEncoding(java.lang.String).

Parameters:
XMLDecl - True if expecting XML document declaration, false if expecting external entity/subset declaration
Returns:
True if XML document is standalone
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing

readTokenMarkup

protected final int readTokenMarkup()
                             throws SAXException,
                                    java.io.IOException
Reads markup token. Returns the token code and the token value in _tokenText. The preceding '<' has been consumed prior to calling this method. No valid character is held in _curChar on entry or exit.

The following rules govern how tokens are parsed and which code is returned:

  • TOKEN_OPEN_TAG returned for opening tag. Opening tag is '<' immediately followed by valid tag name (returned as token text) and optional whitespace. Attributes and terminating '>' are not read by this method. A whitespace between the '<' and tag name is not allowed
  • TOKEN_CLOSE_TAG returned for closing tag. Closing tag is '</' followed by valid tag name (returned as token text) and '>'. All text following the tag name until the terminating '>' is ignored; a whitespace between the '<' and tag name is not allowed; an empty tag name will be returned.
  • TOKEN_COMMENT returned for comment. Comment is terminated with '<!--' and '-->'. All text inbetween is consumed, and returned as token text if in mode Parser.MODE_STORE_COMMENT.
  • TOKEN_CDATA returned for CDATA section. Section starts with '<![CDATA[' and ends with ']]>'. All text inbetween is consumed and returned as token text.
  • TOKEN_PI returned for processing instruction. Processing instruction is terminated with '<?' and '?>'. All text inbetween is consumed, and returned as token text if in mode Parser.MODE_STORE_PI.
  • TOKEN_DTD returned for DTD declaration. DTD declaration starts with '<!' immediately followed by a token name (returned as token text). All other declaration contents is not read by this method. A whitespace between the '<!' and the token name is not allowed, and the token name is all uppercase letters.
  • TOKEN_SECTION returned for DTD conditional section. Conditional section begins with '<![' and is not a CDATA section. Only the '<![' sequence is read and consumed by this method.
If no markup is found, the token code TOKEN_TEXT is returned, with '<' contained in _tokenText and the input stream is not affected.
Returns:
The markup token code of TOKEN_TEXT
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing
java.io.IOException - An I/O exception has been encountered when reading from the input stream

readTokenEntity

protected final int readTokenEntity()
                             throws SAXException,
                                    java.io.IOException
Reads general entity reference token or character reference. Returns the token code TOKEN_ENTITY_REF and the entity name in _tokenText. The preceding '&' has been consumed prior to calling this method, and the trailing ';' is consumed by this method. No valid character is held in _curChar on entry or exit.

If no valid entity name is found, the token code TOKEN_TEXT is returned, with '&' contained in _tokenText and the input stream is not affected.

A '#' sign indicates a character reference (either decimal or hexadecimal) which is read and stored in _tokenText, and the token code TOKEN_TEXT is returned. If the character reference value is invalid, the token code TOKEN_TEXT is returned, with '&' contained in _tokenText and the input stream is not affected.

If the entity reference or character reference is not terminated with a ';', a well-formed error is issued, but the entity reference is still regarded valid.

Returns:
Token code either TOKEN_ENTITY_REF or TOKEN_TEXT
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing
java.io.IOException - An I/O exception has been encountered when reading from the input stream

readTokenPERef

protected final int readTokenPERef()
                            throws SAXException,
                                   java.io.IOException
Reads parameter entity reference token. Returns the token code TOKEN_PE_REF and the entity name in _tokenText. The preceding '%' has been consumed prior to calling this method, and the trailing ';' is consumed by this method. No valid character is held in _curChar on entry or exit.

If no valid entity name is found, the token code TOKEN_TEXT is returned, with '%' contained in _tokenText and the input stream is not affected.

If the entity reference is not terminated with a ';', a well-formed error is issued, but the entity reference is still regarded valid.

Returns:
Token code either TOKEN_PE_REF or TOKEN_TEXT
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing
java.io.IOException - An I/O exception has been encountered when reading from the input stream

slicePITokenText

protected final java.lang.String slicePITokenText()
                                           throws SAXException
Slices processing instruction text into target and instruction code. Called with the processing instruction text in _tokenText, returning the valid target name, and _tokenText truncated to contain just the instruction code. If no valid target name is found, an empty name is returned.
Returns:
The target name
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing

readTokenQuoted

protected final boolean readTokenQuoted()
                                 throws SAXException,
                                        java.io.IOException
Reads the quoted identifier token. Quotes can be either single or double, but both opening and closing quotes must be identical. Everything inbetween the quotes is stored in _tokenText. Returns true if a quoted value was found (i.e. opening quote followed on the input stream).
Returns:
True if quoted value was found
Throws:
SAXException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing
java.io.IOException - An I/O exception has been encountered when reading from the input stream

readTokenName

protected final boolean readTokenName()
                               throws java.io.IOException
Reads a valid token name and places it in _tokenText. If a valid name can be read, it is placed in _tokenText and true is returned, otherwise false is returned and the input stream is not affected.

A valid token name is defined as consisting of any letter, underscore or colon, followed by zero or more letters and digits, underscores, hyphens, colons and periods. Unlike other languages, letters and digits can be specified in all Unicode supported languages.

_curChar does not contain a valid value on either entry or exit from this method.

Returns:
True if valid name of at least one character found
Throws:
java.io.IOException - An I/O exception has been encountered when reading from the input stream

canReadName

protected final boolean canReadName(java.lang.String name)
                             throws java.io.IOException
Returns true if the specified name can be read and consumes it all. Attempts to read the name in its entirety. If the name is read, it is consumed from the input stream and the method returns true. If the name is not read, the input stream is not affected and the method return false.
Returns:
True if the name was read and consumed in its entirety
Throws:
java.io.IOException - An I/O exception has been encountered when reading from the input stream

isTokenAllSpace

protected final boolean isTokenAllSpace()
Returns true if the token is all whitespace. The token is contained in _tokenText and all its characters must be whitespace as defined by isSpace(int).
Returns:
True if _tokenText is all whitespace

isNamePart

protected final boolean isNamePart(int ch,
                                   boolean first)
Returns true if character is part of a valid name. The first flag indicates whether character is expected to be the first or any other in the name.

Valid names are defined as consisting of any letter, underscore or colon, followed by zero or more letters and digits, underscores, hyphens, colons and periods. Unlike other languages, letters and digits can be specified in all Unicode supported languages.

Parameters:
ch - The character to test
first - True if first letter in the name
Returns:
True if character is valid in name context

isSpace

protected final boolean isSpace(int ch)
Returns true if character is a whitespace. Space (0x20), tab (0x09), line feed (0x0A), carriage return (0x0D) and form feed (0x0C) are defined as whitespaces.
Parameters:
ch - The character to check
Returns:
True if character is a whitespace

readChar

protected final int readChar()
                      throws java.io.IOException
Reads and returns a single character from the input stream. If characters were pushed back they are returned in the same order they were pushed (LIFO). If end of input stream has been reached, EOF is returned. The returned character is also available in the _curChar variable.

Line breaks (LF, CR and CR+LF) are returned as a single line feed (0x0A) character.

Returns:
A single character read from the input stream, also available in _curChar
Throws:
java.io.IOException - An I/O exception has been encountered when reading from the input stream

pushBack

protected final void pushBack()
Push back the last character read into _curChar. The pushed back character will be returned when readChar() is called next. Any number of characters can be pushed back. The push back buffer is a LIFO stack, so text should be pushed back in reverse order. It is not an error to push back the value EOF.

pushBack

protected final void pushBack(int ch)
Push back a single character. The pushed back character will be returned when readChar() is called next. Any number of characters can be pushed back. The push back buffer is a LIFO stack, so text should be pushed back in reverse order. It is not an error to push back the value EOF.
Parameters:
ch - The character to push back

setEncoding

protected final void setEncoding(java.lang.String encoding)
Changes the encoding of the input stream. This is only effective if the input stream is of type XMLStreamReader and will do nothing otherwise. Nothing happens if the encoding is not recognized.

getReader

protected final java.io.Reader getReader()
Returns the reader used for accessing the underlying input stream.
Returns:
Reader used by this parser

close

protected final void close()
Closes the input stream.

isClosed

protected final boolean isClosed()
Returns true if the document has been fully parsed and the parsed has been closed. Parsing operations should be rejected when the parser is closed. The parser is closed by calling the close() method.
Returns:
True if parser has been closed

advanceLineNumber

protected final void advanceLineNumber(int increment)
Advances the line number count by the specified increment. Used when a different parses chews through the same input stream, obscuring the line number count. Specifically, when DTDParser is used to read the internal subset in an XML document.
Parameters:
increment - The line number increment

getLastException

public SAXParseException getLastException()
Error reporting and logging, and source location methods
Specified by:
getLastException in interface org.openxml.io.Parser

getLineNumber

public final int getLineNumber()
Specified by:
getLineNumber in interface Locator

getSourcePosition

public final int getSourcePosition()

getColumnNumber

public final int getColumnNumber()
Specified by:
getColumnNumber in interface Locator

getSystemId

public final java.lang.String getSystemId()
Specified by:
getSystemId in interface Locator

getPublicId

public final java.lang.String getPublicId()
Specified by:
getPublicId in interface Locator

getLocator

public final Locator getLocator()

warning

public final void warning(java.lang.String message)
                   throws SAXException

fatalError

public final void fatalError(java.lang.Exception except)
                      throws SAXException

error

public final void error(int errorLevel,
                        java.lang.String message)
                 throws SAXException

setErrorHandler

public final void setErrorHandler(ErrorHandler handler)
Associates this parser with an error handler. By default the parser creates and users an ErrorReport for reporting errors. Some applications may wish to provide their own error handler, by calling this method. If the handler is set to null, all errors encountered in the code will throw an exception and stop the parser.
Parameters:
handler - The new error handler to use, or null
See Also:
ErrorHandler, ErrorReport

getErrorHandler

public final ErrorHandler getErrorHandler()
Returns the error handler associated with this parser (if any). By default this is an ErrorReport.
Returns:
The error handler of this parser, or null
See Also:
ErrorHandler

getErrorReport

public final ErrorReport getErrorReport()
Returns the error report facility associated with this parser (if any). By default a parser will have such a report acting as its error handler, unless replaced by the application. This object can be used to extract the list of parsing errors, and may also be passed along to further processing stages.
Specified by:
getErrorReport in interface org.openxml.io.Parser
Returns:
The error handler of this parser, or null
See Also:
ErrorHandler

setErrorSink

public final void setErrorSink(ErrorSinkHandler errorSink)
Deprecated. Use setErrorHandler(org.xml.sax.ErrorHandler) instead

getSourceURI

public final java.lang.String getSourceURI()
Deprecated. Use getSystemId() instead.

isMode

protected final boolean isMode(short mode)
Returns true if the specified parsing mode is in effect. For example, mode( MODE_STORE_COMMENT ) will return true if comment storing mode has been selected. A combination of MODE_.. flags can be used with this method.
Parameters:
mode - The mode(s) to check
Returns:
True if the mode(s) are in effect

getMode

protected final short getMode()
Returns the current parsing mode.
Returns:
The current parsing mode