|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--org.apache.avalon.excalibur.xml.JaxpParser
An XMLParser that is only dependant on JAXP 1.1 compliant parsers. The configuration can contain the following parameters :
false
) : should the parser
validate parsed documents ?
false
) : do we want
namespaces declarations also as 'xmlns:' attributes ?true
confuses some XSL
processors (e.g. Saxon).
true
) : should the parser
stop parsing if a warning occurs ?
true
) : should the parser
stop parsing if a recoverable error occurs ?
true
) : do we want to reuse
parsers or create a new parser for each parse ?true
, parsers are not
recycled in case of parsing errors : some parsers (e.g. Xerces) don't like
to be reused after failure.
Field Summary | |
protected javax.xml.parsers.DocumentBuilder |
docBuilder
The DOM builder. |
protected javax.xml.parsers.DocumentBuilderFactory |
docFactory
the Document Builder factory |
protected javax.xml.parsers.SAXParserFactory |
factory
the SAX Parser factory |
protected org.apache.avalon.framework.component.ComponentManager |
manager
the component manager |
protected boolean |
nsPrefixes
do we want namespaces also as attributes ? |
protected org.xml.sax.XMLReader |
reader
The SAX reader. |
protected EntityResolver |
resolver
the Entity Resolver |
protected boolean |
reuseParsers
do we want to reuse parsers ? |
protected boolean |
stopOnRecoverableError
do we stop on recoverable errors ? |
protected boolean |
stopOnWarning
do we stop on warnings ? |
Fields inherited from interface org.apache.avalon.excalibur.xml.Parser |
ROLE |
Constructor Summary | |
JaxpParser()
|
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
Get the Entity Resolver from the component manager |
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Receive notification of a fatal error. |
void |
parameterize(org.apache.avalon.framework.parameters.Parameters params)
Configure |
void |
parse(org.xml.sax.InputSource in,
org.xml.sax.ContentHandler consumer)
Parse the InputSource and send
SAX events to the consumer. |
org.w3c.dom.Document |
parseDocument(org.xml.sax.InputSource input)
Parses a new Document object from the given InputSource. |
protected void |
setupDocumentBuilder()
Creates a new DocumentBuilder if needed. |
protected void |
setupXMLReader()
Creates a new XMLReader if needed. |
void |
warning(org.xml.sax.SAXParseException e)
Receive notification of a warning. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.xml.parsers.SAXParserFactory factory
protected javax.xml.parsers.DocumentBuilderFactory docFactory
protected org.xml.sax.XMLReader reader
setupXMLReader()
and cleared if a parsing error occurs.protected javax.xml.parsers.DocumentBuilder docBuilder
setupDocumentBuilder()
and cleared if a parsing error occurs.protected org.apache.avalon.framework.component.ComponentManager manager
protected EntityResolver resolver
protected boolean nsPrefixes
protected boolean reuseParsers
protected boolean stopOnWarning
protected boolean stopOnRecoverableError
Constructor Detail |
public JaxpParser()
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager manager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
public void parameterize(org.apache.avalon.framework.parameters.Parameters params)
parameterize
in interface org.apache.avalon.framework.parameters.Parameterizable
public void parse(org.xml.sax.InputSource in, org.xml.sax.ContentHandler consumer) throws org.xml.sax.SAXException, java.io.IOException
Parser
InputSource
and send
SAX events to the consumer.
Attention: the consumer can either be an XMLConsumer
or implement the LexicalHandler
as well.
The parse should take care of this.parse
in interface Parser
public org.w3c.dom.Document parseDocument(org.xml.sax.InputSource input) throws org.xml.sax.SAXException, java.io.IOException
parseDocument
in interface Parser
protected void setupXMLReader() throws org.xml.sax.SAXException
XMLReader
if needed.protected void setupDocumentBuilder() throws org.xml.sax.SAXException
DocumentBuilder
if needed.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
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |