|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.core.xml.impl.AbstractJaxpParser org.apache.cocoon.core.xml.impl.JaxpSAXParser
A SAX parser which uses a JAXP 1.1 compliant parsers.
AbstractJaxpParser
Nested Class Summary | |
protected static class |
JaxpSAXParser.DtdCommentEater
A LexicalHandler implementation that strips all comment events between startDTD and endDTD. |
Field Summary | |
protected boolean |
dropDtdComments
Should comments appearing between start/endDTD events be dropped ? |
protected SAXParserFactory |
factory
the SAX Parser factory |
protected boolean |
nsPrefixes
do we want namespaces also as attributes ? |
protected String |
saxParserFactoryName
The name of the sax parser factory. |
protected boolean |
stopOnRecoverableError
do we stop on recoverable errors ? |
protected boolean |
stopOnWarning
do we stop on warnings ? |
Fields inherited from class org.apache.cocoon.core.xml.impl.AbstractJaxpParser |
resolver, searchResolver, validate |
Constructor Summary | |
JaxpSAXParser()
|
Method Summary | |
void |
error(SAXParseException spe)
Receive notification of a recoverable error. |
void |
fatalError(SAXParseException spe)
Receive notification of a fatal error. |
String |
getSaxParserFactoryName()
Return the name of the sax parser factory. |
protected void |
initSaxParserFactory()
Initialize the sax parser factory. |
boolean |
isDropDtdComments()
|
boolean |
isNsPrefixes()
|
boolean |
isStopOnRecoverableError()
|
boolean |
isStopOnWarning()
|
void |
parse(InputSource in,
ContentHandler consumer)
|
void |
parse(InputSource in,
ContentHandler contentHandler,
LexicalHandler lexicalHandler)
|
void |
setDropDtdComments(boolean dropDtdComments)
Should comment() events from DTD's be dropped? (Default is false.) Since this implementation does not support the DeclHandler interface anyway, it is quite useless to only have the comments from DTD. |
void |
setNsPrefixes(boolean nsPrefixes)
Do we want namespaces declarations also as 'xmlns:' attributes ? Default is false. |
void |
setSaxParserFactoryName(String saxParserFactoryName)
Set the name of the SAXParserFactory
implementation class to be used instead of using the standard JAXP mechanism
(SAXParserFactory.newInstance() ). |
void |
setStopOnRecoverableError(boolean stopOnRecoverableError)
Should the parser stop parsing if a recoverable error occurs ? Default is true. |
void |
setStopOnWarning(boolean stopOnWarning)
Should the parser stop parsing if a warning occurs ? Default is true. |
protected XMLReader |
setupXMLReader()
Creates a new XMLReader if needed. |
void |
warning(SAXParseException spe)
Receive notification of a warning. |
Methods inherited from class org.apache.cocoon.core.xml.impl.AbstractJaxpParser |
getEntityResolver, getLogger, isSearchResolver, isValidate, loadClass, setBeanFactory, setEntityResolver, setLogger, setSearchResolver, setValidate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SAXParserFactory factory
protected boolean nsPrefixes
protected boolean stopOnWarning
protected boolean stopOnRecoverableError
protected boolean dropDtdComments
protected String saxParserFactoryName
Constructor Detail |
public JaxpSAXParser()
Method Detail |
public boolean isDropDtdComments()
setDropDtdComments(boolean)
public void setDropDtdComments(boolean dropDtdComments)
public boolean isNsPrefixes()
setNsPrefixes(boolean)
public void setNsPrefixes(boolean nsPrefixes)
true
confuses some XSL
processors (e.g. Saxon).
public boolean isStopOnRecoverableError()
setStopOnRecoverableError(boolean)
public void setStopOnRecoverableError(boolean stopOnRecoverableError)
public boolean isStopOnWarning()
setStopOnWarning(boolean)
public void setStopOnWarning(boolean stopOnWarning)
public String getSaxParserFactoryName()
setSaxParserFactoryName(String)
public void setSaxParserFactoryName(String saxParserFactoryName)
SAXParserFactory
implementation class to be used instead of using the standard JAXP mechanism
(SAXParserFactory.newInstance()
). This allows to choose
unambiguously the JAXP implementation to be used when several of them are
available in the classpath.
protected void initSaxParserFactory() throws Exception
Exception
public void parse(InputSource in, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws SAXException, IOException
parse
in interface org.apache.cocoon.core.xml.SAXParser
SAXException
IOException
SAXParser.parse(org.xml.sax.InputSource, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)
public void parse(InputSource in, ContentHandler consumer) throws SAXException, IOException
parse
in interface org.apache.cocoon.core.xml.SAXParser
SAXException
IOException
SAXParser.parse(org.xml.sax.InputSource, org.xml.sax.ContentHandler)
protected XMLReader setupXMLReader() throws SAXException
XMLReader
if needed.
SAXException
public void error(SAXParseException spe) throws SAXException
error
in interface ErrorHandler
SAXException
public void fatalError(SAXParseException spe) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public void warning(SAXParseException spe) throws SAXException
warning
in interface ErrorHandler
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |