org.cdlib.xtf.xslt
Class XMLStubReader

Object
  extended by DTDSuppressingXMLReader
      extended by XMLStubReader
All Implemented Interfaces:
XMLReader

 class XMLStubReader
extends DTDSuppressingXMLReader

Like a normal XMLReader, except that it stops processing when the first end-element tag is encountered. This reads in the first part of an XML file, which is like a "stub" version of the file. Also, we jump through very special hoops to make the DTD declaration available (it's not normally part of Saxon's data model.) This file created November 1, 2007 by Martin Haye


Nested Class Summary
private  class XMLStubReader.GetOut
          Thrown after the first element end marker is found
private  class XMLStubReader.StubContentHandler
          Handles content events from the XML parser.
private  class XMLStubReader.StubLexicalHandler
          Handles 'lexical' events.
 
Field Summary
 
Fields inherited from class DTDSuppressingXMLReader
reader
 
Constructor Summary
XMLStubReader()
           
 
Method Summary
 void parse(InputSource input)
          Parse the input document, but stop at the first end-element marker
 void setContentHandler(ContentHandler handler)
          Establish the content handler that will receive events.
 void setProperty(String name, Object value)
          Catch requests to set the "lexical handler".
 
Methods inherited from class DTDSuppressingXMLReader
equals, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, hashCode, parse, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLStubReader

XMLStubReader()
Method Detail

setContentHandler

public void setContentHandler(ContentHandler handler)
Establish the content handler that will receive events. We wrap it to perform special processing.

Specified by:
setContentHandler in interface XMLReader
Overrides:
setContentHandler in class DTDSuppressingXMLReader

setProperty

public void setProperty(String name,
                        Object value)
                 throws SAXNotRecognizedException,
                        SAXNotSupportedException
Catch requests to set the "lexical handler". We insert a stub handler in the chain so we can catch the DTD declaration.

Specified by:
setProperty in interface XMLReader
Overrides:
setProperty in class DTDSuppressingXMLReader
Throws:
SAXNotRecognizedException
SAXNotSupportedException

parse

public void parse(InputSource input)
           throws IOException,
                  SAXException
Parse the input document, but stop at the first end-element marker

Specified by:
parse in interface XMLReader
Overrides:
parse in class DTDSuppressingXMLReader
Throws:
IOException
SAXException