public class DOMFragmentParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CURRENT_ELEMENT_NODE
Current element node.
|
protected static java.lang.String |
DOCUMENT_FRAGMENT
Document fragment balancing only.
|
protected static java.lang.String |
ERROR_HANDLER
Property identifier: error handler.
|
protected org.w3c.dom.Node |
fCurrentNode
Current node.
|
protected org.w3c.dom.Document |
fDocument
Document.
|
protected org.w3c.dom.DocumentFragment |
fDocumentFragment
DOM document fragment.
|
protected XMLDocumentSource |
fDocumentSource
Document source.
|
protected boolean |
fInCDATASection
True if within a CDATA section.
|
protected XMLParserConfiguration |
fParserConfiguration
Parser configuration.
|
protected static java.lang.String[] |
RECOGNIZED_FEATURES
Recognized features.
|
protected static java.lang.String[] |
RECOGNIZED_PROPERTIES
Recognized properties.
|
Constructor and Description |
---|
DOMFragmentParser()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(XMLString text,
Augmentations augs)
Characters.
|
void |
comment(XMLString text,
Augmentations augs)
Comment.
|
void |
doctypeDecl(java.lang.String root,
java.lang.String pubid,
java.lang.String sysid,
Augmentations augs)
Document type declaration.
|
void |
emptyElement(QName element,
XMLAttributes attrs,
Augmentations augs)
Empty element.
|
void |
endCDATA(Augmentations augs)
End CDATA section.
|
void |
endDocument(Augmentations augs)
End document.
|
void |
endElement(QName element,
Augmentations augs)
End element.
|
void |
endGeneralEntity(java.lang.String name,
Augmentations augs)
End general entity.
|
void |
endPrefixMapping(java.lang.String prefix,
Augmentations augs)
End prefix mapping.
|
XMLDocumentSource |
getDocumentSource()
Returns the document source.
|
org.xml.sax.ErrorHandler |
getErrorHandler()
Return the current error handler.
|
boolean |
getFeature(java.lang.String featureId)
Query the state of a feature.
|
java.lang.Object |
getProperty(java.lang.String propertyId)
Query the value of a property.
|
void |
ignorableWhitespace(XMLString text,
Augmentations augs)
Ignorable whitespace.
|
void |
parse(org.xml.sax.InputSource source,
org.w3c.dom.DocumentFragment fragment)
Parses a document fragment.
|
void |
parse(java.lang.String systemId,
org.w3c.dom.DocumentFragment fragment)
Parses a document fragment.
|
void |
processingInstruction(java.lang.String target,
XMLString data,
Augmentations augs)
Processing instruction.
|
void |
setDocumentSource(XMLDocumentSource source)
Sets the document source.
|
void |
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Allow an application to register an error event handler.
|
void |
setFeature(java.lang.String featureId,
boolean state)
Set the state of any feature in a SAX2 parser.
|
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Set the value of any property in a SAX2 parser.
|
void |
startCDATA(Augmentations augs)
Start CDATA section.
|
void |
startDocument(XMLLocator locator,
java.lang.String encoding,
Augmentations augs)
Start document.
|
void |
startDocument(XMLLocator locator,
java.lang.String encoding,
NamespaceContext nscontext,
Augmentations augs)
Start document.
|
void |
startElement(QName element,
XMLAttributes attrs,
Augmentations augs)
Start element.
|
void |
startGeneralEntity(java.lang.String name,
XMLResourceIdentifier id,
java.lang.String encoding,
Augmentations augs)
Start general entity.
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
Augmentations augs)
Start prefix mapping.
|
void |
textDecl(java.lang.String version,
java.lang.String encoding,
Augmentations augs)
Text declaration.
|
void |
xmlDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone,
Augmentations augs)
XML declaration.
|
protected static final java.lang.String DOCUMENT_FRAGMENT
protected static final java.lang.String[] RECOGNIZED_FEATURES
protected static final java.lang.String ERROR_HANDLER
protected static final java.lang.String CURRENT_ELEMENT_NODE
protected static final java.lang.String[] RECOGNIZED_PROPERTIES
protected XMLParserConfiguration fParserConfiguration
protected XMLDocumentSource fDocumentSource
protected org.w3c.dom.DocumentFragment fDocumentFragment
protected org.w3c.dom.Document fDocument
protected org.w3c.dom.Node fCurrentNode
protected boolean fInCDATASection
public void parse(java.lang.String systemId, org.w3c.dom.DocumentFragment fragment) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public void parse(org.xml.sax.InputSource source, org.w3c.dom.DocumentFragment fragment) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
errorHandler
- The error handler.java.lang.NullPointerException
- If the handler
argument is null.getErrorHandler()
public org.xml.sax.ErrorHandler getErrorHandler()
setErrorHandler(org.xml.sax.ErrorHandler)
public void setFeature(java.lang.String featureId, boolean state) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature.state
- The requested state of the feature (true or false).org.xml.sax.SAXNotRecognizedException
- If the
requested feature is not known.org.xml.sax.SAXNotSupportedException
- If the
requested feature is known, but the requested
state is not supported.public boolean getFeature(java.lang.String featureId) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature
being set.org.xml.sax.SAXNotRecognizedException
- If the
requested feature is not known.org.xml.sax.SAXNotSupportedException
- If the
requested feature is known but not supported.public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.value
- The value to which the property is being set.org.xml.sax.SAXNotRecognizedException
- If the
requested property is not known.org.xml.sax.SAXNotSupportedException
- If the
requested property is known, but the requested
value is not supported.public java.lang.Object getProperty(java.lang.String propertyId) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.org.xml.sax.SAXNotRecognizedException
- If the
requested property is not known.org.xml.sax.SAXNotSupportedException
- If the
requested property is known but not supported.public void setDocumentSource(XMLDocumentSource source)
public XMLDocumentSource getDocumentSource()
public void startDocument(XMLLocator locator, java.lang.String encoding, Augmentations augs) throws XNIException
XNIException
public void startDocument(XMLLocator locator, java.lang.String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException
XNIException
public void xmlDecl(java.lang.String version, java.lang.String encoding, java.lang.String standalone, Augmentations augs) throws XNIException
XNIException
public void doctypeDecl(java.lang.String root, java.lang.String pubid, java.lang.String sysid, Augmentations augs) throws XNIException
XNIException
public void processingInstruction(java.lang.String target, XMLString data, Augmentations augs) throws XNIException
XNIException
public void comment(XMLString text, Augmentations augs) throws XNIException
XNIException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri, Augmentations augs) throws XNIException
XNIException
public void endPrefixMapping(java.lang.String prefix, Augmentations augs) throws XNIException
XNIException
public void startElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException
XNIException
public void emptyElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException
XNIException
public void characters(XMLString text, Augmentations augs) throws XNIException
XNIException
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException
XNIException
public void startGeneralEntity(java.lang.String name, XMLResourceIdentifier id, java.lang.String encoding, Augmentations augs) throws XNIException
XNIException
public void textDecl(java.lang.String version, java.lang.String encoding, Augmentations augs) throws XNIException
XNIException
public void endGeneralEntity(java.lang.String name, Augmentations augs) throws XNIException
XNIException
public void startCDATA(Augmentations augs) throws XNIException
XNIException
public void endCDATA(Augmentations augs) throws XNIException
XNIException
public void endElement(QName element, Augmentations augs) throws XNIException
XNIException
public void endDocument(Augmentations augs) throws XNIException
XNIException
(C) Copyright 2002-2014, Andy Clark, Marc Guillemot. All rights reserved.