Name
DOMResult
Synopsis
This class
is a Result
implementation that writes XML content
by generating a DOM tree to represent that content. If you pass an
org.w3c.dom.Node
to the constructor or to
setNode( )
, the DOMResult
will create the result tree as a child of the specified node (which
should typically be a Document
or
Element
node). If you do not specify a node, the
DOMResult
will create a new
Document
node when it creates the result tree. You
can retrieve this Document
with getNode(
)
. In Java 5.0, you can also pass two
Node
objects to the constructor: these specify the
parent node of the result tree and the child of that parent before
which the result tree should be inserted. See also
setNextSibling( )
.
Figure 20-9. javax.xml.transform.dom.DOMResult
public class DOMResult implements javax.xml.transform.Result { // Public Constructors public DOMResult( ); public DOMResult(org.w3c.dom.Node node); 5.0 public DOMResult(org.w3c.dom.Node node, org.w3c.dom.Node nextSibling); public DOMResult(org.w3c.dom.Node node, String systemId); 5.0 public DOMResult(org.w3c.dom.Node node, org.w3c.dom.Node nextSibling, String systemId); // Public Constants public static final String FEATURE; ="http://javax.xml.transform.dom.DOMResult/feature" // Public Instance Methods 5.0 public org.w3c.dom.Node getNextSibling( ); default:null public org.w3c.dom.Node getNode( ); default:null 5.0 public void setNextSibling ...
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.