Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 1065
نمايش فراداده

DOMResultjavax.xml.transform.dom

Java 1.4

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 (org.w3c.dom.Node

nextSibling ); public void

setNode (org.w3c.dom.Node

node ); // Methods Implementing Result public String

getSystemId ( ); default:null public void

setSystemId (String

systemId ); }