|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.Builder
The abstract Builder class is responsible for taking a stream of SAX events and constructing a Document tree. There is one concrete subclass for each tree implementation.
Field Summary | |
protected java.lang.String |
baseURI
|
protected DocumentInfo |
currentDocument
|
protected boolean |
discardComments
|
protected int |
documentNumber
|
protected org.xml.sax.ErrorHandler |
errorHandler
|
protected java.io.Writer |
errorOutput
|
protected int |
estimatedLength
|
protected boolean |
failed
|
protected boolean |
inDTD
|
protected boolean |
lineNumbering
|
protected org.xml.sax.Locator |
locator
|
protected NamePool |
namePool
|
protected Sequencer |
nodeSequencer
|
protected org.xml.sax.XMLReader |
parser
|
protected PreviewManager |
previewManager
|
static int |
STANDARD_TREE
|
protected boolean |
started
|
protected Stripper |
stripper
|
protected boolean |
timing
|
static int |
TINY_TREE
|
Constructor Summary | |
Builder()
create a Builder and initialise variables |
Method Summary | |
DocumentInfo |
build(org.xml.sax.InputSource in)
Build the tree from an input source. |
abstract void |
characters(char[] ch,
int start,
int length)
Callback interface for SAX: not for application use |
abstract void |
comment(char[] ch,
int start,
int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use |
abstract void |
endDocument()
Callback interface for SAX: not for application use |
abstract void |
endElement(int nameCode)
Callback interface for SAX: not for application use |
void |
error(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
void |
fatalError(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
int |
getColumnNumber()
|
DocumentInfo |
getCurrentDocument()
Get the current document |
int |
getDocumentNumber()
Get the sequence number for the document |
int |
getLineNumber()
|
NamePool |
getNamePool()
Get the namepool used for this document |
Sequencer |
getNodeSequencer()
Get the sequencer used for allocating node numbers |
java.lang.String |
getPublicId()
|
java.lang.String |
getSystemId()
|
org.xml.sax.XMLReader |
getXMLReader()
Get the SAX2 parser in use. |
boolean |
isTiming()
Get timing option |
abstract void |
processingInstruction(java.lang.String name,
java.lang.String remainder)
Callback interface for SAX: not for application use Note: because SAX1 does not deliver comment nodes, we get these in the form of a processing instruction with a null name. |
protected void |
reportError(org.xml.sax.SAXParseException e,
boolean isFatal)
Common routine for errors and fatal errors |
void |
setCharacterSet(CharacterSet charset)
Set the CharacterSet to be used. |
void |
setDiscardCommentsAndPIs(boolean discard)
Indicate whether comments and Processing Instructions should be discarded |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Callback interface for SAX: not for application use |
void |
setDocumentNumber(int seq)
Set the sequence number for the document |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Set the error handler to use. |
void |
setErrorOutput(java.io.Writer writer)
Set output for error messages produced by the default error handler. The default error handler does not throw an exception for parse errors or input I/O errors, rather it returns a result code and writes diagnostics to a user-specified output writer, which defaults to System.err This call has no effect if setErrorHandler() has been called to supply a user-defined error handler |
void |
setEscaping(boolean escaping)
Switch escaping on or off. |
void |
setLineNumbering(boolean onOrOff)
Set line numbering on or off |
void |
setNamePool(NamePool pool)
Set the namepool to be used for all names in the document |
void |
setNodeSequencer(Sequencer seq)
Set the sequencer used for allocating node numbers |
void |
setOutputDetails(OutputDetails details)
Set output details. |
void |
setParser(org.xml.sax.Parser parser)
Set the SAX1-compliant parser to use. |
void |
setPreviewManager(PreviewManager pm)
Set the PreviewManager to use |
void |
setStripAll()
Request stripping of all whitespace text nodes. |
void |
setStripper(Stripper s)
Set the Stripper to use |
void |
setSystemId(java.lang.String uri)
|
void |
setTiming(boolean on)
Set timing option on or off |
abstract void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri)
Set the URI for an unparsed entity in the document. |
void |
setWriter(java.io.Writer writer)
Methods to satisfy the Emitter interface |
void |
setXMLReader(org.xml.sax.XMLReader parser)
Set the SAX2-compliant parser to use. |
abstract void |
startDocument()
Callback interface for SAX: not for application use |
abstract void |
startElement(int nameCode,
org.xml.sax.Attributes attributes,
int[] namespaces,
int nscount)
Callback interface for SAX: not for application use |
void |
warning(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STANDARD_TREE
public static final int TINY_TREE
protected int estimatedLength
protected java.io.Writer errorOutput
protected Stripper stripper
protected PreviewManager previewManager
protected boolean discardComments
protected int documentNumber
protected Sequencer nodeSequencer
protected DocumentInfo currentDocument
protected org.xml.sax.XMLReader parser
protected org.xml.sax.ErrorHandler errorHandler
protected org.xml.sax.Locator locator
protected java.lang.String baseURI
protected NamePool namePool
protected boolean failed
protected boolean started
protected boolean timing
protected boolean inDTD
protected boolean lineNumbering
Constructor Detail |
public Builder()
Method Detail |
public void setTiming(boolean on)
public boolean isTiming()
public void setNamePool(NamePool pool)
setNamePool
in interface Emitter
public NamePool getNamePool()
public void setDocumentNumber(int seq)
public int getDocumentNumber()
public void setNodeSequencer(Sequencer seq)
public Sequencer getNodeSequencer()
public void setParser(org.xml.sax.Parser parser)
parser
- The XML parser to use. This must be an instance of a class
that implements the org.xml.sax.Parser interface.ParserManager
public void setXMLReader(org.xml.sax.XMLReader parser)
parser
- The XML parser to use. This must be an instance of a class
that implements the org.xml.sax.XMLReader interface.ParserManager
public org.xml.sax.XMLReader getXMLReader()
public void setLineNumbering(boolean onOrOff)
public void setStripper(Stripper s)
public void setStripAll()
public void setPreviewManager(PreviewManager pm)
public void setDiscardCommentsAndPIs(boolean discard)
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
eh
- The error handler to use. It must conform to the interface
org.xml.sax.ErrorHandlerpublic void setErrorOutput(java.io.Writer writer)
writer
- The Writer to use for error messagespublic DocumentInfo build(org.xml.sax.InputSource in) throws org.xml.sax.SAXException
source
- The InputSource to use. InputSource is a SAX-defined class that
allows input from a URL, a byte stream, or a character stream. SAXON also
provides a subclass, ExtendedInputSource, that allows input directly from a File.org.xml.sax.SAXException
- if the input document could not be read or if it was not parsed
correctly.public DocumentInfo getCurrentDocument()
public abstract void startDocument() throws org.xml.sax.SAXException
startDocument
in interface Emitter
public abstract void endDocument() throws org.xml.sax.SAXException
endDocument
in interface Emitter
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface Emitter
public abstract void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws org.xml.sax.SAXException
startElement
in interface Emitter
com.icl.saxon.output.Emitter
namespaces
- Array of namespace codes identifying the namespace prefix/uri
pairs associated with this elementnscount
- Number of significant entries within namespaces arraypublic abstract void endElement(int nameCode) throws org.xml.sax.SAXException
endElement
in interface Emitter
public abstract void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface Emitter
public abstract void processingInstruction(java.lang.String name, java.lang.String remainder) throws org.xml.sax.SAXException
processingInstruction
in interface Emitter
public abstract void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface Emitter
public void warning(org.xml.sax.SAXParseException e)
warning
in interface org.xml.sax.ErrorHandler
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
protected void reportError(org.xml.sax.SAXParseException e, boolean isFatal)
public abstract void setUnparsedEntity(java.lang.String name, java.lang.String uri)
setUnparsedEntity
in interface Emitter
public void setWriter(java.io.Writer writer) throws org.xml.sax.SAXException
setWriter
in interface Emitter
public void setCharacterSet(CharacterSet charset) throws org.xml.sax.SAXException
Emitter
setCharacterSet
in interface Emitter
public void setEscaping(boolean escaping) throws org.xml.sax.SAXException
Emitter
setEscaping
in interface Emitter
public void setOutputDetails(OutputDetails details) throws org.xml.sax.SAXException
Emitter
setOutputDetails
in interface Emitter
com.icl.saxon.output.Emitter
details
- The details of the required outputpublic void setSystemId(java.lang.String uri)
public java.lang.String getSystemId()
getSystemId
in interface org.xml.sax.Locator
public java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |