Added in API level 8

DOMResult

open class DOMResult : Result
kotlin.Any
   ↳ javax.xml.transform.dom.DOMResult

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().

Summary

Constants
static String

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

Inherited constants
Public constructors

Zero-argument default constructor.

DOMResult(node: Node!)

Use a DOM node to create a new output target.

DOMResult(node: Node!, systemId: String!)

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

DOMResult(node: Node!, nextSibling: Node!)

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

DOMResult(node: Node!, nextSibling: Node!, systemId: String!)

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.

Public methods
open Node!

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

open Node!

Get the node that will contain the result DOM tree.

open String!

Get the System Identifier.

open Unit
setNextSibling(nextSibling: Node!)

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

open Unit
setNode(node: Node!)

Set the node that will contain the result DOM tree.

open Unit
setSystemId(systemId: String!)

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

Constants

FEATURE

Added in API level 8
static val FEATURE: String

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

Value: "http://javax.xml.transform.dom.DOMResult/feature"

Public constructors

DOMResult

Added in API level 8
DOMResult()

Zero-argument default constructor.

node, siblingNode and systemId will be set to null.

DOMResult

Added in API level 8
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.

DOMResult

Added in API level 8
DOMResult(
    node: Node!,
    systemId: String!)

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.

DOMResult

Added in API level 8
DOMResult(
    node: Node!,
    nextSibling: Node!)

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(org.w3c.dom.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
java.lang.IllegalArgumentException If node is null and nextSibling is not null.

DOMResult

Added in API level 8
DOMResult(
    node: Node!,
    nextSibling: Node!,
    systemId: String!)

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(org.w3c.dom.Node,java.lang.String), 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
java.lang.IllegalArgumentException If node is null and nextSibling is not null.

Public methods

getNextSibling

Added in API level 8
open fun getNextSibling(): Node!

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

If no node was set via DOMResult(org.w3c.dom.Node,org.w3c.dom.Node), DOMResult(org.w3c.dom.Node,org.w3c.dom.Node,java.lang.String) or setNextSibling(org.w3c.dom.Node), then null will be returned.

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

getNode

Added in API level 8
open fun getNode(): Node!

Get the node that will contain the result DOM tree.

If no node was set via DOMResult(org.w3c.dom.Node), DOMResult(org.w3c.dom.Node,java.lang.String), DOMResult(org.w3c.dom.Node,org.w3c.dom.Node), DOMResult(org.w3c.dom.Node,org.w3c.dom.Node,java.lang.String) or setNode(org.w3c.dom.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.

Return
Node! The node to which the transformation will be appended.

getSystemId

Added in API level 8
open fun getSystemId(): String!

Get the System Identifier.

If no System ID was set via DOMResult(org.w3c.dom.Node,java.lang.String), DOMResult(org.w3c.dom.Node,org.w3c.dom.Node,java.lang.String) or setSystemId(java.lang.String), then null will be returned.

Return
String! The system identifier.

setNextSibling

Added in API level 8
open fun setNextSibling(nextSibling: Node!): Unit

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(org.w3c.dom.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
java.lang.IllegalArgumentException If nextSibling is not a descendant of node.
java.lang.IllegalStateException If node is null and nextSibling is not null.

setNode

Added in API level 8
open fun setNode(node: Node!): Unit

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
java.lang.IllegalStateException If node is null and nextSibling is not null.

setSystemId

Added in API level 8
open fun setSystemId(systemId: String!): Unit

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

Parameters
systemId String!: The system identifier as a URI string.