|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.brownell.xml.DomParser2
This parser emits SAX2 parsing events as it traverses a DOM tree, using any conformant implementation of DOM. It exposes all SAX 1.0 features, and the following SAX 2 (1-June-1999 draft) features and properties (as identified by standard URIs which are not fully provided here).
Name | Type | Notes |
---|---|---|
validation | Feature | false (does no parsing) |
external-general-entities | Feature | false (does no parsing) |
external-parameter-entities | Feature | false (does no parsing) |
namespaces | Feature | Value is fixed at false |
normalize-text | Feature | Value is fixed at false; if you want normalized events for characters, you can get them by first normalizing the DOM tree. |
use-locator | Feature | false (does no parsing) |
dom-node | Property | This property may be set before parsing to hold a DOM Document node; any arguments given to parse methods are ignored. When retrieved during a parse, this value contains the "current" DOM node. |
DeclHandler | Property | A declaration handler may be provided. Declaration of external general entities is exposed, but not parameter entities; none of the entity names reported here will begin with "%". |
LexicalHandler | Property | A lexical handler may be provided. While the start and end of any external subset are reported, expansion of other parameter entities (e.g. inside attribute list declarations) is not exposed. Expansion of general entities within attributes is also not exposed (see below). |
Note that the current SAX2 draft has no standard way to provide the initial DOM document. This parser supports that facility through the property holding the current DOM node: it may be set when not parsing, to a DOM Document node which is used to generate the events of the next parse.
The consequences of modifying a DOM document tree as it is being walked by this "parser" are unspecified; don't do it!
Constructor Summary | |
DomParser2()
Constructs an unitialized SAX2 parser. |
Method Summary | |
boolean |
getFeature(java.lang.String featureId)
SAX2: Tells whether this parser supports the specified feature. |
java.lang.Object |
getProperty(java.lang.String propertyId)
SAX2: Returns the specified property. |
void |
parse(org.xml.sax.InputSource input)
SAX1: Parses the previously provided DOM document (the input parameter is ignored). |
void |
parse(java.lang.String uri)
SAX1: Parses the previously provided DOM document (the input parameter is ignored). |
void |
setDocumentHandler(org.xml.sax.DocumentHandler handler)
SAX1: Provides an object which receives callbacks for the most significant document information. |
void |
setDTDHandler(org.xml.sax.DTDHandler handler)
SAX1: Provides an object which may be used to intercept declarations related to notations and unparsed entities. |
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
SAX1: Provides an object which may be used when resolving external entities during parsing (both general and parameter entities). |
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
SAX1: Provides an object which receives callbacks for XML errors of all levels (fatal, nonfatal, warning). |
void |
setFeature(java.lang.String featureId,
boolean state)
SAX2: Sets the state of features supported in this parser. |
void |
setLocale(java.util.Locale locale)
SAX1: Identifies the locale which the parser should use for the diagnostics it provides. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object property)
SAX2: Assigns the specified property. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DomParser2()
Method Detail |
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
public void setDTDHandler(org.xml.sax.DTDHandler handler)
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
public void setLocale(java.util.Locale locale) throws org.xml.sax.SAXException
public void parse(java.lang.String uri) throws org.xml.sax.SAXException, java.io.IOException
uri
- ignored (pass an empty string)public void parse(org.xml.sax.InputSource input) throws org.xml.sax.SAXException, java.io.IOException
input
- ignoredpublic boolean getFeature(java.lang.String featureId) throws org.xml.sax.SAXException
public java.lang.Object getProperty(java.lang.String propertyId) throws org.xml.sax.SAXException
public void setFeature(java.lang.String featureId, boolean state) throws org.xml.sax.SAXException
public void setProperty(java.lang.String propertyId, java.lang.Object property) throws org.xml.sax.SAXException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |