APIdia Launch Partner
Top Description Fields Constructors Methods
javax.xml.transform.dom

public Class DOMResult

extends Object
implements Result
Class Inheritance
All Implemented Interfaces
javax.xml.transform.Result
Imports
javax.xml.transform.Result, org.w3c.dom.Node

Acts as a holder for a transformation result tree in the form of a Document Object Model (DOM) tree.

If no output DOM source is set, the transformation will create a Document node as the holder for the result of the transformation, which may be retrieved with getNode().

Author
Jeff Suttor
Since
1.4

Field Summary

Modifier and TypeField and Description
public static final String
FEATURE

If javax.xml.transform.TransformerFactory#getFeature returns true when passed this value as an argument, the Transformer supports Result output of this type.

private Node
nextSibling

The child node before which the result nodes will be inserted.

private Node
node

The node to which the transformation will be appended.

private String
systemId

The System ID that may be used in association with the node.

Constructor Summary

AccessConstructor and Description
public
DOMResult()

Zero-argument default constructor.

public
DOMResult(Node
The DOM node that will contain the result tree.
node
)

Use a DOM node to create a new output target.

public
DOMResult(Node
The DOM node that will contain the result tree.
node
,
String
The system identifier which may be used in association with this node.
systemId
)

Use a DOM node to create a new output target with the specified System ID.

In practice, the node should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node.

public
DOMResult(Node
The DOM node that will contain the result tree.
node
,
Node
The child node where the result nodes should be inserted before.
nextSibling
)

Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before.

public
DOMResult(Node
The DOM node that will contain the result tree.
node
,
Node
The child node where the result nodes should be inserted before.
nextSibling
,
String
The system identifier which may be used in association with this node.
systemId
)

Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before and the specified System ID.

In practice, node and nextSibling should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node.

Method Summary

Modifier and TypeMethod and Description
public Node

Returns:

The child node before which the result nodes will be inserted.
getNextSibling
()

Get the child node before which the result nodes will be inserted.

public Node

Returns:

The node to which the transformation will be appended.
getNode
()

Get the node that will contain the result DOM tree.

public String

Returns:

The system identifier.
getSystemId
()

Implements javax.xml.transform.Result.getSystemId.

Get the System Identifier.

public void
setNextSibling(Node
The child node before which the result nodes will be inserted.
nextSibling
)

Set the child node before which the result nodes will be inserted.

public void
setNode(Node
The node to which the transformation will be appended.
node
)

Set the node that will contain the result DOM tree.

public void
setSystemId(String
The system identifier as a URI string.
systemId
)

Implements javax.xml.transform.Result.setSystemId.

Set the systemId that may be used in association with the node.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FEATUREback to summary
public static final String FEATURE

If javax.xml.transform.TransformerFactory#getFeature returns true when passed this value as an argument, the Transformer supports Result output of this type.

nextSiblingback to summary
private Node nextSibling

The child node before which the result nodes will be inserted.

Since
1.5
nodeback to summary
private Node node

The node to which the transformation will be appended.

systemIdback to summary
private String systemId

The System ID that may be used in association with the node.

Constructor Detail

DOMResultback to summary
public DOMResult()

Zero-argument default constructor.

node, siblingNode and systemId will be set to null.

DOMResultback to summary
public DOMResult(Node node)

Use a DOM node to create a new output target.

In practice, the node should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node. In other words, a node that accepts children.

siblingNode and systemId will be set to null.

Parameters
node:Node

The DOM node that will contain the result tree.

DOMResultback to summary
public DOMResult(Node node, String systemId)

Use a DOM node to create a new output target with the specified System ID.

In practice, the node should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node. In other words, a node that accepts children.

siblingNode will be set to null.

Parameters
node:Node

The DOM node that will contain the result tree.

systemId:String

The system identifier which may be used in association with this node.

DOMResultback to summary
public DOMResult(Node node, Node nextSibling)

Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before.

In practice, node and nextSibling should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node. In other words, a node that accepts children.

Use nextSibling to specify the child node where the result nodes should be inserted before. If nextSibling is not a sibling of node, then an IllegalArgumentException is thrown. If node is null and nextSibling is not null, then an IllegalArgumentException is thrown. If nextSibling is null, then the behavior is the same as calling DOMResult(Node node), i.e. append the result nodes as the last child of the specified node.

systemId will be set to null.

Parameters
node:Node

The DOM node that will contain the result tree.

nextSibling:Node

The child node where the result nodes should be inserted before.

Exceptions
IllegalArgumentException:
If nextSibling is not a sibling of node or node is null and nextSibling is not null.
Since
1.5
DOMResultback to summary
public DOMResult(Node node, Node nextSibling, String systemId)

Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before and the specified System ID.

In practice, node and nextSibling should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node. In other words, a node that accepts children.

Use nextSibling to specify the child node where the result nodes should be inserted before. If nextSibling is not a sibling of node, then an IllegalArgumentException is thrown. If node is null and nextSibling is not null, then an IllegalArgumentException is thrown. If nextSibling is null, then the behavior is the same as calling DOMResult(Node node, String systemId), i.e. append the result nodes as the last child of the specified node and use the specified System ID.

Parameters
node:Node

The DOM node that will contain the result tree.

nextSibling:Node

The child node where the result nodes should be inserted before.

systemId:String

The system identifier which may be used in association with this node.

Exceptions
IllegalArgumentException:
If nextSibling is not a sibling of node or node is null and nextSibling is not null.
Since
1.5

Method Detail

getNextSiblingback to summary
public Node getNextSibling()

Get the child node before which the result nodes will be inserted.

If no node was set via DOMResult(Node node, Node nextSibling), DOMResult(Node node, Node nextSibling, String systemId) or setNextSibling(Node nextSibling), then null will be returned.

Returns:Node

The child node before which the result nodes will be inserted.

Since
1.5
getNodeback to summary
public Node getNode()

Get the node that will contain the result DOM tree.

If no node was set via DOMResult(Node node), DOMResult(Node node, String systeId), DOMResult(Node node, Node nextSibling), DOMResult(Node node, Node nextSibling, String systemId) or setNode(Node node), then the node will be set by the transformation, and may be obtained from this method once the transformation is complete. Calling this method before the transformation will return null.

Returns:Node

The node to which the transformation will be appended.

getSystemIdback to summary
public String getSystemId()

Implements javax.xml.transform.Result.getSystemId.

Get the System Identifier.

If no System ID was set via DOMResult(Node node, String systemId), DOMResult(Node node, Node nextSibling, String systemId) or setSystemId(String systemId), then null will be returned.

Returns:String

The system identifier.

setNextSiblingback to summary
public void setNextSibling(Node nextSibling)

Set the child node before which the result nodes will be inserted.

Use nextSibling to specify the child node before which the result nodes should be inserted. If nextSibling is not a descendant of node, then an IllegalArgumentException is thrown. If node is null and nextSibling is not null, then an IllegalStateException is thrown. If nextSibling is null, then the behavior is the same as calling DOMResult(Node node), i.e. append the result nodes as the last child of the specified node.

Parameters
nextSibling:Node

The child node before which the result nodes will be inserted.

Exceptions
IllegalArgumentException:
If nextSibling is not a descendant of node.
IllegalStateException:
If node is null and nextSibling is not null.
Since
1.5
setNodeback to summary
public void setNode(Node node)

Set the node that will contain the result DOM tree.

In practice, the node should be a org.w3c.dom.Document node, a org.w3c.dom.DocumentFragment node, or a org.w3c.dom.Element node. In other words, a node that accepts children.

An IllegalStateException is thrown if nextSibling is not null and node is not a parent of nextSibling. An IllegalStateException is thrown if node is null and nextSibling is not null.

Parameters
node:Node

The node to which the transformation will be appended.

Exceptions
IllegalStateException:
If nextSibling is not null and nextSibling is not a child of node or node is null and nextSibling is not null.
setSystemIdback to summary
public void setSystemId(String systemId)

Implements javax.xml.transform.Result.setSystemId.

Set the systemId that may be used in association with the node.

Parameters
systemId:String

The system identifier as a URI string.