fi.hut.tml.xsmiles.xml
Class XercesXMLParser

java.lang.Object
  extended byorg.apache.xerces.parsers.XMLParser
      extended byorg.apache.xerces.parsers.AbstractXMLDocumentParser
          extended byorg.apache.xerces.parsers.AbstractDOMParser
              extended byorg.apache.xerces.parsers.DOMParser
                  extended byfi.hut.tml.xsmiles.xml.XercesXMLParser
All Implemented Interfaces:
org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler, XMLParser

public class XercesXMLParser
extends org.apache.xerces.parsers.DOMParser
implements org.xml.sax.ErrorHandler, XMLParser, org.xml.sax.EntityResolver

Contains the DOM-implementation used by the current configuration.

Version:
$Revision: 6533 $
Author:
Mikko Honkala

Field Summary
 org.xml.sax.SAXParseException lastParseException
           
 
Fields inherited from class org.apache.xerces.parsers.DOMParser
SYMBOL_TABLE, XMLGRAMMAR_POOL
 
Fields inherited from class org.apache.xerces.parsers.AbstractDOMParser
CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDocument, fInDTD, fInDTDExternalSubset, fInternalSubset, fNamespaceAware, fRejectedElement, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, PSVI_DOCUMENT_CLASS_NAME
 
Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
fDocumentSource, fDTDContentModelSource, fDTDSource
 
Fields inherited from class org.apache.xerces.parsers.XMLParser
ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
 
Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
 
Constructor Summary
XercesXMLParser(Browser browser)
          Constructor.
 
Method Summary
 org.w3c.dom.Document createEmptyDocument()
           
 void error(org.xml.sax.SAXParseException ex)
          Error.
 void fatalError(org.xml.sax.SAXParseException ex)
          Fatal error.
 org.xml.sax.SAXParseException getLastParseException()
           
 org.w3c.dom.Document openDocument(java.io.InputStream sourceStream, boolean presentationDOM)
           
 org.w3c.dom.Document openDocument(java.io.InputStream sourceStream, boolean presentationDOM, java.lang.String documentURL)
          Reads a document from and InputStream to a DOM tree This method was added for i18n.
 org.w3c.dom.Document openDocument(java.io.Reader sourceReader, boolean presentationDOM)
          Reads an document to DOM tree
 org.w3c.dom.Document openDocument(java.net.URL url)
          Reads an document to DOM tree
 org.w3c.dom.Document openDocument(java.net.URL url, java.lang.String documentClassname)
           
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 void warning(org.xml.sax.SAXParseException ex)
          Warning.
 java.lang.String write(org.w3c.dom.Node doc)
          Writes the dom node to a string.
 java.lang.String write(org.w3c.dom.Node doc, boolean prettyPrinting)
          The main write method, writes the DOM document to a Writer
 void write(java.io.Writer writer, org.w3c.dom.Node node, boolean prettyPrinting)
           
 void write(java.io.Writer writer, org.w3c.dom.Node doc, boolean preserveSpace, boolean indenting)
           
 void writeWithoutXMLDecl(java.io.Writer writer, org.w3c.dom.Node node)
           
 
Methods inherited from class org.apache.xerces.parsers.DOMParser
getEntityResolver, getErrorHandler, getFeature, getProperty, parse, parse, setEntityResolver, setErrorHandler, setFeature, setProperty
 
Methods inherited from class org.apache.xerces.parsers.AbstractDOMParser
abort, attributeDecl, characters, comment, createAttrNode, createElementNode, doctypeDecl, elementDecl, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, reset, setCharacterData, setDocumentClassName, setLocale, startAttlist, startCDATA, startConditional, startDocument, startDTD, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
 
Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
 
Methods inherited from class org.apache.xerces.parsers.XMLParser
parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastParseException

public org.xml.sax.SAXParseException lastParseException
Constructor Detail

XercesXMLParser

public XercesXMLParser(Browser browser)
Constructor. Creates a new instance of the DOM-parser.

Method Detail

openDocument

public org.w3c.dom.Document openDocument(java.io.Reader sourceReader,
                                         boolean presentationDOM)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads an document to DOM tree

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.io.InputStream sourceStream,
                                         boolean presentationDOM,
                                         java.lang.String documentURL)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads a document from and InputStream to a DOM tree This method was added for i18n. A parser assumes that a Reader source is already in Unicode, whereas it will check the xml header for the encoding of an InputStream.

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.net.URL url,
                                         java.lang.String documentClassname)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Specified by:
openDocument in interface XMLParser
Throws:
java.io.IOException
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.net.URL url)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Reads an document to DOM tree

Specified by:
openDocument in interface XMLParser
Returns:
read DOM document.
Throws:
java.io.IOException
org.xml.sax.SAXException

write

public java.lang.String write(org.w3c.dom.Node doc,
                              boolean prettyPrinting)
The main write method, writes the DOM document to a Writer

Specified by:
write in interface XMLParser

write

public java.lang.String write(org.w3c.dom.Node doc)
Writes the dom node to a string. Note! Uses Jaxp transformations.

Specified by:
write in interface XMLParser

write

public void write(java.io.Writer writer,
                  org.w3c.dom.Node node,
                  boolean prettyPrinting)
Specified by:
write in interface XMLParser

write

public void write(java.io.Writer writer,
                  org.w3c.dom.Node doc,
                  boolean preserveSpace,
                  boolean indenting)

writeWithoutXMLDecl

public void writeWithoutXMLDecl(java.io.Writer writer,
                                org.w3c.dom.Node node)
                         throws java.io.IOException
Specified by:
writeWithoutXMLDecl in interface XMLParser
Throws:
java.io.IOException

getLastParseException

public org.xml.sax.SAXParseException getLastParseException()
Specified by:
getLastParseException in interface XMLParser

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver

createEmptyDocument

public org.w3c.dom.Document createEmptyDocument()
Specified by:
createEmptyDocument in interface XMLParser

warning

public void warning(org.xml.sax.SAXParseException ex)
Warning.

Specified by:
warning in interface org.xml.sax.ErrorHandler

error

public void error(org.xml.sax.SAXParseException ex)
Error.

Specified by:
error in interface org.xml.sax.ErrorHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException ex)
                throws org.xml.sax.SAXException
Fatal error.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

openDocument

public org.w3c.dom.Document openDocument(java.io.InputStream sourceStream,
                                         boolean presentationDOM)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException
Specified by:
openDocument in interface XMLParser
Throws:
java.io.IOException
org.xml.sax.SAXException


X-Smiles 1.2