public class DOMUtils extends Object
| Constructor and Description |
|---|
DOMUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
getFirstChildElementByTagName(Node parentNode,
String elementName)
Returns the first child element retrieved by tag name from the parent node and null otherwise.
|
static Collection<Element> |
getFirstChildElementsByTagName(Node contextNode,
String elementName)
Returns list of the first child element retrieved by tag name from the parent node and null otherwise.
|
static Document |
load(InputStream stream) |
static Document |
load(String xml) |
static void |
save(Node node,
OutputStream out) |
static void |
save(Node node,
Writer writer) |
public static Document load(InputStream stream) throws ParserConfigurationException, SAXException, IOException
public static Document load(String xml) throws ParserConfigurationException, SAXException, IOException
public static void save(Node node, Writer writer) throws TransformerException
TransformerExceptionpublic static void save(Node node, OutputStream out) throws TransformerException
TransformerExceptionpublic static Element getFirstChildElementByTagName(Node parentNode, String elementName)
parentNode - parent node.elementName - element name to found.public static Collection<Element> getFirstChildElementsByTagName(Node contextNode, String elementName)
parentNode - parent node.elementName - element name to found.Copyright © 2015. All Rights Reserved.