org.openxml.parser
Class DTDParser

java.lang.Object
  |
  +--org.openxml.parser.BaseParser
        |
        +--org.openxml.parser.DTDParser

public class DTDParser
extends BaseParser

Version:
$Revision: 1.9 $ $Date: 1999/04/18 01:52:12 $
Author:
Assaf Arkin
See Also:
Parser

Fields inherited from class org.openxml.parser.BaseParser
_curChar, _document, _tokenText, CR, EOF, LF, SPACE, TOKEN_CDATA, TOKEN_CLOSE_TAG, TOKEN_COMMENT, TOKEN_DTD, TOKEN_ENTITY_REF, TOKEN_EOF, TOKEN_OPEN_TAG, TOKEN_PE_REF, TOKEN_PI, TOKEN_SECTION, TOKEN_SECTION_END, TOKEN_TEXT
 
Constructor Summary
DTDParser(BaseParser owner, java.io.Reader reader, java.lang.String sourceURI)
          Constructor for entity parser.
DTDParser(java.io.Reader reader, java.lang.String sourceURI)
           
DTDParser(java.io.Reader reader, java.lang.String sourceURI, short mode, short stopAtSeverity)
           
 
Method Summary
protected  Attr createAttribute(java.lang.String attrName)
           
 Document parseDocument()
           
 DTDDocument parseExternalSubset(DTDDocument dtd)
           
 DTDDocument parseInternalSubset(DTDDocument dtd)
           
 Node parseNode(Node node)
           
 DTDDocument parseParamEntity(DTDDocument dtd, boolean internal)
           
protected  org.openxml.dom.ParamEntity parseParamEntity(org.openxml.dom.ParamEntity entity)
          Parses the parameter entity, returning the entity as parsed.
 
Methods inherited from class org.openxml.parser.BaseParser
advanceLineNumber, canReadName, close, error, fatalError, getColumnNumber, getErrorHandler, getErrorReport, getLastException, getLineNumber, getLocator, getMode, getPublicId, getReader, getSourcePosition, getSourceURI, getSystemId, isClosed, isMode, isNamePart, isSpace, isTokenAllSpace, parseDocumentDecl, parseGeneralEntity, pushBack, pushBack, readChar, readTokenEntity, readTokenMarkup, readTokenName, readTokenPERef, readTokenQuoted, setEncoding, setErrorHandler, setErrorSink, slicePITokenText, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTDParser

public DTDParser(java.io.Reader reader,
                 java.lang.String sourceURI,
                 short mode,
                 short stopAtSeverity)

DTDParser

public DTDParser(BaseParser owner,
                 java.io.Reader reader,
                 java.lang.String sourceURI)
Constructor for entity parser. Requires a parent parser to be specified and will use that parser's document, dtd, error sink and mode (assuming that Parser.MODE_PARSE_ENTITY is in effect). The severity level is set to Parser.STOP_SEVERITY_FATAL.
Parameters:
owner - The parser which invoked this parser
reader - Any Reader from which entity text can be read
sourceURI - URI of entity source

DTDParser

public DTDParser(java.io.Reader reader,
                 java.lang.String sourceURI)
Method Detail

parseInternalSubset

public DTDDocument parseInternalSubset(DTDDocument dtd)
                                throws SAXException

parseExternalSubset

public DTDDocument parseExternalSubset(DTDDocument dtd)
                                throws SAXException

parseParamEntity

public DTDDocument parseParamEntity(DTDDocument dtd,
                                    boolean internal)
                             throws SAXException

parseDocument

public Document parseDocument()
                       throws SAXException

parseNode

public final Node parseNode(Node node)
                     throws SAXException

parseParamEntity

protected final org.openxml.dom.ParamEntity parseParamEntity(org.openxml.dom.ParamEntity entity)
                                                      throws SAXException
Parses the parameter entity, returning the entity as parsed. An existing ParamEntity 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:

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

createAttribute

protected Attr createAttribute(java.lang.String attrName)