|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xerces.util.ParserConfigurationSettings
org.cyberneko.html.HTMLConfiguration
An XNI-based parser configuration that can be used to parse HTML documents. This configuration can be used directly in order to parse HTML documents or can be used in conjunction with any XNI based tools, such as the Xerces2 implementation.
This configuration recognizes the following features:
This configuration recognizes the following properties:
For complete usage information, refer to the documentation.
HTMLScanner
,
HTMLTagBalancer
,
HTMLErrorReporter
Nested Class Summary | |
protected class |
HTMLConfiguration.ErrorReporter
Defines an error reporter for reporting HTML errors. |
Field Summary | |
protected static String |
AUGMENTATIONS
Include infoset augmentations. |
protected static String |
BALANCE_TAGS
Balance tags. |
protected static String |
ERROR_DOMAIN
Error domain. |
protected static String |
ERROR_REPORTER
Error reporter. |
protected boolean |
fCloseStream
Stream opened by parser. |
protected XMLDocumentHandler |
fDocumentHandler
Document handler. |
protected HTMLScanner |
fDocumentScanner
Document scanner. |
protected XMLDTDContentModelHandler |
fDTDContentModelHandler
DTD content model handler. |
protected XMLDTDHandler |
fDTDHandler
DTD handler. |
protected XMLEntityResolver |
fEntityResolver
Entity resolver. |
protected XMLErrorHandler |
fErrorHandler
Error handler. |
protected HTMLErrorReporter |
fErrorReporter
Error reporter. |
protected Vector |
fHTMLComponents
Components. |
protected static String |
FILTERS
Pipeline filters. |
protected Locale |
fLocale
Locale. |
protected NamespaceBinder |
fNamespaceBinder
Namespace binder. |
protected HTMLTagBalancer |
fTagBalancer
HTML tag balancer. |
protected static String |
NAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }. |
protected static String |
NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }. |
protected static String |
NAMESPACES
Namespaces. |
protected static String |
REPORT_ERRORS
Report errors. |
protected static String |
SIMPLE_ERROR_FORMAT
Simple report format. |
protected static boolean |
XERCES_2_0_0
Parser version is Xerces 2.0.0. |
protected static boolean |
XERCES_2_0_1
Parser version is Xerces 2.0.1. |
protected static boolean |
XML4J_4_0_x
Parser version is XML4J 4.0.x. |
Fields inherited from class org.apache.xerces.util.ParserConfigurationSettings |
fFeatures, fParentSettings, fProperties, fRecognizedFeatures, fRecognizedProperties, PARSER_SETTINGS |
Constructor Summary | |
HTMLConfiguration()
Default constructor. |
Method Summary | |
protected void |
addComponent(HTMLComponent component)
Adds a component. |
void |
cleanup()
If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing. |
XMLDocumentHandler |
getDocumentHandler()
Returns the document handler. |
XMLDTDContentModelHandler |
getDTDContentModelHandler()
Returns the DTD content model handler. |
XMLDTDHandler |
getDTDHandler()
Returns the DTD handler. |
XMLEntityResolver |
getEntityResolver()
Returns the entity resolver. |
XMLErrorHandler |
getErrorHandler()
Returns the error handler. |
Locale |
getLocale()
Returns the locale. |
boolean |
parse(boolean complete)
Parses the document in a pull parsing fashion. |
void |
parse(XMLInputSource source)
Parses a document. |
void |
pushInputSource(XMLInputSource inputSource)
Pushes an input source onto the current entity stack. |
protected void |
reset()
Resets the parser configuration. |
void |
setDocumentHandler(XMLDocumentHandler handler)
Sets the document handler. |
void |
setDTDContentModelHandler(XMLDTDContentModelHandler handler)
Sets the DTD content model handler. |
void |
setDTDHandler(XMLDTDHandler handler)
Sets the DTD handler. |
void |
setEntityResolver(XMLEntityResolver resolver)
Sets the entity resolver. |
void |
setErrorHandler(XMLErrorHandler handler)
Sets the error handler. |
void |
setFeature(String featureId,
boolean state)
Sets a feature. |
void |
setInputSource(XMLInputSource inputSource)
Sets the input source for the document to parse. |
void |
setLocale(Locale locale)
Sets the locale. |
void |
setProperty(String propertyId,
Object value)
Sets a property. |
Methods inherited from class org.apache.xerces.util.ParserConfigurationSettings |
addRecognizedFeatures, addRecognizedProperties, checkFeature, checkProperty, getFeature, getProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.xerces.xni.parser.XMLParserConfiguration |
addRecognizedFeatures, addRecognizedProperties, getFeature, getProperty |
Field Detail |
protected static final String NAMESPACES
protected static final String AUGMENTATIONS
protected static final String REPORT_ERRORS
protected static final String SIMPLE_ERROR_FORMAT
protected static final String BALANCE_TAGS
protected static final String NAMES_ELEMS
protected static final String NAMES_ATTRS
protected static final String FILTERS
protected static final String ERROR_REPORTER
protected static final String ERROR_DOMAIN
protected XMLDocumentHandler fDocumentHandler
protected XMLDTDHandler fDTDHandler
protected XMLDTDContentModelHandler fDTDContentModelHandler
protected XMLErrorHandler fErrorHandler
protected XMLEntityResolver fEntityResolver
protected Locale fLocale
protected boolean fCloseStream
protected Vector fHTMLComponents
protected HTMLScanner fDocumentScanner
protected HTMLTagBalancer fTagBalancer
protected NamespaceBinder fNamespaceBinder
protected HTMLErrorReporter fErrorReporter
protected static boolean XERCES_2_0_0
protected static boolean XERCES_2_0_1
protected static boolean XML4J_4_0_x
Constructor Detail |
public HTMLConfiguration()
Method Detail |
public void pushInputSource(XMLInputSource inputSource)
Hint: To use this feature to insert the output of <SCRIPT> tags, remember to buffer the entire output of the processed instructions before pushing a new input source. Otherwise, events may appear out of sequence.
inputSource
- The new input source to start scanning.public void setFeature(String featureId, boolean state) throws XMLConfigurationException
setFeature
in interface XMLParserConfiguration
XMLConfigurationException
public void setProperty(String propertyId, Object value) throws XMLConfigurationException
setProperty
in interface XMLParserConfiguration
XMLConfigurationException
public void setDocumentHandler(XMLDocumentHandler handler)
setDocumentHandler
in interface XMLParserConfiguration
public XMLDocumentHandler getDocumentHandler()
getDocumentHandler
in interface XMLParserConfiguration
public void setDTDHandler(XMLDTDHandler handler)
setDTDHandler
in interface XMLParserConfiguration
public XMLDTDHandler getDTDHandler()
getDTDHandler
in interface XMLParserConfiguration
public void setDTDContentModelHandler(XMLDTDContentModelHandler handler)
setDTDContentModelHandler
in interface XMLParserConfiguration
public XMLDTDContentModelHandler getDTDContentModelHandler()
getDTDContentModelHandler
in interface XMLParserConfiguration
public void setErrorHandler(XMLErrorHandler handler)
setErrorHandler
in interface XMLParserConfiguration
public XMLErrorHandler getErrorHandler()
getErrorHandler
in interface XMLParserConfiguration
public void setEntityResolver(XMLEntityResolver resolver)
setEntityResolver
in interface XMLParserConfiguration
public XMLEntityResolver getEntityResolver()
getEntityResolver
in interface XMLParserConfiguration
public void setLocale(Locale locale)
setLocale
in interface XMLParserConfiguration
public Locale getLocale()
getLocale
in interface XMLParserConfiguration
public void parse(XMLInputSource source) throws XNIException, IOException
parse
in interface XMLParserConfiguration
XNIException
IOException
public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException
setInputSource
in interface XMLPullParserConfiguration
inputSource
- The document's input source.
XMLConfigurationException
- Thrown if there is a
configuration error when initializing the
parser.
IOException
- Thrown on I/O error.parse(boolean)
public boolean parse(boolean complete) throws XNIException, IOException
parse
in interface XMLPullParserConfiguration
complete
- True if the pull parser should parse the
remaining document completely.
XNIException
- Any XNI exception, possibly wrapping
another exception.
IOException
- An IO exception from the parser, possibly
from a byte stream or character stream
supplied by the parser.setInputSource(org.apache.xerces.xni.parser.XMLInputSource)
public void cleanup()
cleanup
in interface XMLPullParserConfiguration
protected void addComponent(HTMLComponent component)
protected void reset() throws XMLConfigurationException
XMLConfigurationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |