DOMSource
Stay organized with collections
Save and categorize content based on your preferences.
Acts as a holder for a transformation Source tree in the
form of a Document Object Model (DOM) tree.
Note that XSLT requires namespace support. Attempting to transform a DOM
that was not contructed with a namespace-aware parser may result in errors.
Parsers can be made namespace aware by calling
DocumentBuilderFactory.setNamespaceAware(boolean)
.
Public Constructor Summary
|
DOMSource()
Zero-argument default constructor.
|
|
|
|
DOMSource( Node node, String systemID)
Create a new input source with a DOM node, and with the
system ID also passed in as the base URI.
|
Public Method Summary
Node
|
getNode()
Get the node that represents a Source DOM tree.
|
String
|
getSystemId()
Get the base ID (URL or system ID) from where URLs
will be resolved.
|
void
|
setNode( Node node)
Set the node that will represents a Source DOM tree.
|
void
|
setSystemId( String systemID)
Set the base ID (URL or system ID) from where URLs
will be resolved.
|
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Constants
public
static
final
String
FEATURE
Constant Value:
"http://javax.xml.transform.dom.DOMSource/feature"
Public Constructors
public
DOMSource
(Node n)
Create a new input source with a DOM node. The operation
will be applied to the subtree rooted at this node. In XSLT,
a "/" pattern still means the root of the tree (not the subtree),
and the evaluation of global variables and parameters is done
from the root node also.
Parameters
n |
The DOM node that will contain the Source tree.
|
public
DOMSource
(Node node, String systemID)
Create a new input source with a DOM node, and with the
system ID also passed in as the base URI.
Parameters
node |
The DOM node that will contain the Source tree. |
systemID |
Specifies the base URI associated with node.
|
Public Methods
public
Node
getNode
()
Get the node that represents a Source DOM tree.
Returns
- The node that is to be transformed.
public
String
getSystemId
()
Get the base ID (URL or system ID) from where URLs
will be resolved.
Returns
- Base URL for this DOM tree.
public
void
setNode
(Node node)
Set the node that will represents a Source DOM tree.
Parameters
node |
The node that is to be transformed.
|
public
void
setSystemId
(String systemID)
Set the base ID (URL or system ID) from where URLs
will be resolved.
Parameters
systemID |
Base URL for this DOM tree.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`DOMSource` acts as a container for a DOM tree used as a source for XML transformations."],["It's crucial to use a namespace-aware parser when constructing the DOM tree to avoid errors during transformation."],["`DOMSource` provides constructors to create instances from a DOM node, optionally with a base URI."],["Methods like `getNode()`, `setNode()`, `getSystemId()`, and `setSystemId()` allow interaction with the DOM node and base URI."],["The `FEATURE` constant helps determine if a `Transformer` supports `DOMSource` input."]]],["`DOMSource` acts as a holder for a transformation Source tree in the form of a DOM tree. Key actions include creating a `DOMSource` instance with or without a DOM node and a system ID. Methods allow setting or getting the node representing the DOM tree (`setNode`, `getNode`) and managing the base ID for URL resolution (`setSystemId`, `getSystemId`). Namespace support is essential, requiring namespace-aware parsers. The `FEATURE` constant indicates `Transformer` support for this type of input.\n"]]