nu.xom.converters
Class SAXConverter
java.lang.Objectnu.xom.converters.SAXConverter
public class SAXConverter
extends java.lang.Object
Feeds a XOM Document into a
SAX2 ContentHandler.
SAXConverter(ContentHandler handler)-
Creates a new
SAXConverter.
|
void | convert(Document doc)-
Feed a document through this converter.
|
void | convert(Nodes nodes)-
Converts a
Nodes list into SAX by firing events
into the registered handlers.
|
ContentHandler | getContentHandler()-
Returns the content handler.
|
LexicalHandler | getLexicalHandler()-
Returns the
LexicalHandler for this
converter.
|
void | setContentHandler(ContentHandler handler)-
Set the content handler for this converter.
|
void | setLexicalHandler(LexicalHandler handler)-
Sets the optional lexical handler for this converter.
|
SAXConverter
public SAXConverter(ContentHandler handler)
Creates a new SAXConverter.
handler - the SAX2 content handler
that receives the data
convert
public void convert(Document doc)
throws SAXException
Feed a document through this converter.
doc - the document to pass to SAX
convert
public void convert(Nodes nodes)
throws SAXException
Converts a Nodes list into SAX by firing events
into the registered handlers. This method calls
startDocument before processing the list
of nodes, and calls endDocument after processing
all of them.
nodes - the nodes to pass to SAX
getContentHandler
public ContentHandler getContentHandler()
Returns the content handler.
- SAX2 content handler that receives the data
getLexicalHandler
public LexicalHandler getLexicalHandler()
Returns the LexicalHandler for this
converter. This is only used for comments.
- SAX2 lexical handler that receives
lexical events
setContentHandler
public void setContentHandler(ContentHandler handler)
Set the content handler for this converter.
handler - SAX2 content handler that
receives the data
setLexicalHandler
public void setLexicalHandler(LexicalHandler handler)
Sets the optional lexical handler for this converter.
The only lexical events the converter supplies
are comments.
handler - the lexical handler;
may be null to turn off lexical events
Copyright 2002-2005 Elliotte Rusty Harold
elharo@metalab.unc.edu