Top Description Fields Constructors Methods
org.dom4j.io

public Class DOMDocumentResult

extends SAXResult
Class Inheritance
Imports
javax.xml.transform.sax.SAXResult, org.w3c.dom.Document, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

DOMDocumentResult implements a JAXP SAXResult for a org.w3c.dom.Document.

Authors
James Strachan , Todd Wolff
Version
$Revision: 1.1 $

Field Summary

Modifier and TypeField and Description
private DOMSAXContentHandler
Inherited from javax.xml.transform.sax.SAXResult:
FEATURE

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

the Document created by the transformation
getDocument
()

Retrieves w3c dom object generated via transformation

public void
setHandler(ContentHandler
Must be a non-null ContentHandler reference.
handler
)

Overrides javax.xml.transform.sax.SAXResult.setHandler.

Set the target to be a SAX2 org.xml.sax.ContentHandler.
public void
setLexicalHandler(LexicalHandler
A non-null LexicalHandler for handling lexical parse events.
handler
)

Overrides javax.xml.transform.sax.SAXResult.setLexicalHandler.

Set the SAX2 org.xml.sax.ext.LexicalHandler for the output.
Inherited from javax.xml.transform.sax.SAXResult:
getHandlergetLexicalHandlergetSystemIdsetSystemId

Field Detail

contentHandlerback to summary
private DOMSAXContentHandler contentHandler

Constructor Detail

DOMDocumentResultback to summary
public DOMDocumentResult()
DOMDocumentResultback to summary
public DOMDocumentResult(DOMSAXContentHandler contentHandler)

Method Detail

getDocumentback to summary
public Document getDocument()

Retrieves w3c dom object generated via transformation

Returns:Document

the Document created by the transformation

setHandlerback to summary
public void setHandler(ContentHandler handler)

Overrides javax.xml.transform.sax.SAXResult.setHandler.

Doc from javax.xml.transform.sax.SAXResult.setHandler.

Set the target to be a SAX2 org.xml.sax.ContentHandler.

Parameters
handler:ContentHandler

Must be a non-null ContentHandler reference.

setLexicalHandlerback to summary
public void setLexicalHandler(LexicalHandler handler)

Overrides javax.xml.transform.sax.SAXResult.setLexicalHandler.

Doc from javax.xml.transform.sax.SAXResult.setLexicalHandler.

Set the SAX2 org.xml.sax.ext.LexicalHandler for the output.

This is needed to handle XML comments and the like. If the lexical handler is not set, an attempt should be made by the transformer to cast the org.xml.sax.ContentHandler to a LexicalHandler.

Parameters
handler:LexicalHandler

A non-null LexicalHandler for handling lexical parse events.