|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xml.sax.SAXtoDOM
This class constructs a DOM tree from a series of SAX events
Field Summary | |
protected Node |
currentNode
|
protected int |
currentNodePosition
|
protected Document |
document
|
protected boolean |
level2DOM
|
protected Locator |
locator
|
protected NamespaceStack |
namespaceStack
|
protected boolean |
novellDOM
|
Constructor Summary | |
SAXtoDOM(Document document)
|
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
void |
comment(String data)
Handle a comment |
void |
endDocument()
Receive notification of the end of a document. |
void |
endElement(String name)
Receive notification of the end of an element. |
protected DocumentType |
ensureDocType()
Return the DocumentType object for the document, creating if doesn't yet exist |
Document |
getResult()
Return the result document. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
void |
notationDecl(String name,
String publicId,
String systemId)
Receive notification of a notation declaration event. |
void |
processingInstruction(String target,
String data)
Receive notification of a processing instruction. |
void |
setDocumentLocator(Locator locator)
Receive an object for locating the origin of SAX document events. |
protected void |
setLocatorInfo(NodeImpl node)
Save the Locator information for the current document event
in the NodeImpl instance and set the document order value for the node
instance.
|
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startElement(String name,
AttributeList atts)
Receive notification of the beginning of an element. |
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
Receive notification of an unparsed entity declaration event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Document document
protected Node currentNode
protected int currentNodePosition
protected boolean novellDOM
protected boolean level2DOM
protected Locator locator
protected NamespaceStack namespaceStack
Constructor Detail |
public SAXtoDOM(Document document)
Method Detail |
public Document getResult()
Document
object used with this object.public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface DocumentHandler
locator
- An object that can return the location of
any SAX document event.Locator
public void startDocument() throws SAXException
startDocument
in interface DocumentHandler
SAXException
- Any SAX exception, possibly
wrapping another exception.public void endDocument() throws SAXException
endDocument
in interface DocumentHandler
SAXException
- Any SAX exception, possibly
wrapping another exception.public void startElement(String name, AttributeList atts) throws SAXException
startElement
in interface DocumentHandler
name
- The element type name.atts
- The attributes attached to the element, if any.
SAXException
- Any SAX exception, possibly
wrapping another exception.endElement(java.lang.String)
,
AttributeList
public void endElement(String name) throws SAXException
endElement
in interface DocumentHandler
name
- The element type name
SAXException
- Any SAX exception, possibly
wrapping another exception.public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface DocumentHandler
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
- Any SAX exception, possibly
wrapping another exception.ignorableWhitespace(char[], int, int)
,
Locator
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface DocumentHandler
ch
- The characters from the XML document.start
- The start position in the array.length
- The number of characters to read from the array.
SAXException
- Any SAX exception, possibly
wrapping another exception.characters(char[], int, int)
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface DocumentHandler
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.
SAXException
- Any SAX exception, possibly
wrapping another exception.public void comment(String data) throws SAXException
comment
in interface DocumentCommentHandler
data
- The comment data, that is, everything
between the tags.
SAXException
public void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl
in interface DTDHandler
name
- The notation name.publicId
- The notation's public identifier, or null if
none was given.systemId
- The notation's system identifier, or null if
none was given.
SAXException
- Any SAX exception, possibly
wrapping another exception.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl
in interface DTDHandler
name
- The unparsed entity's name.publicId
- The entity's public identifier, or null if none
was given.systemId
- The entity's system identifier (it must always
have one).notationName
- The name of the associated notation.
SAXException
- Any SAX exception, possibly
wrapping another exception.notationDecl(java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
protected DocumentType ensureDocType()
protected void setLocatorInfo(NodeImpl node)
Locator
information for the current document event
in the NodeImpl
instance and set the document order value for the node
instance.
Note: The passed node should already be inserted into the tree so that
NodeImpl.getBaseURI() returns the base uri correctly from an ancestor node.
node
- The NodeImpl
instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |