public interface DomDocument
Document
. Implementations of this interface must be thread-safe.Modifier and Type | Method and Description |
---|---|
DomDocument |
clone()
Clones the DOM document.
|
DomElement |
createElement(String namespaceUri,
String localName)
Creates a new element in the dom document.
|
DOMSource |
getDomSource()
Returns a new
DOMSource of the document. |
DomElement |
getElementById(String id)
Gets an element by its id.
|
List<DomElement> |
getElementsByNameNs(String namespaceUri,
String localName)
Gets all elements with the namespace and name.
|
DomElement |
getRootElement()
Returns the root element of the document.
|
String |
registerNamespace(String namespaceUri)
Registers a new namespace with a generic prefix.
|
void |
registerNamespace(String prefix,
String namespaceUri)
Registers a new namespace for the prefix.
|
void |
setRootElement(DomElement rootElement)
Sets the root element of the DOM document.
|
DomElement getRootElement()
void setRootElement(DomElement rootElement)
rootElement
- the new root elementDomElement createElement(String namespaceUri, String localName)
namespaceUri
- the namespaceUri of the new elementlocalName
- the localName of the new elementDomElement getElementById(String id)
id
- the id to search forList<DomElement> getElementsByNameNs(String namespaceUri, String localName)
namespaceUri
- the element namespaceURI to search forlocalName
- the element name to search forDOMSource getDomSource()
DOMSource
of the document.
Note that a DOMSource
wraps the underlying Document
which is
not thread-safe. Multiple DOMSources of the same document should be synchronized
by the calling application.DOMSource
String registerNamespace(String namespaceUri)
namespaceUri
- the namespaceUri of the new namespacevoid registerNamespace(String prefix, String namespaceUri)
prefix
- the prefix of the new namespacenamespaceUri
- the namespaceUri of the new namespaceDomDocument clone()
Copyright © 2019. All rights reserved.