public class DomHelper extends Object
Constructor and Description |
---|
DomHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
detach(Node node)
If the node is attached to a parent then detach it
|
static Element |
firstChild(Element element,
String name)
Returns the first child element for the given name
|
static Element |
firstChildElement(Node node)
Returns true if this node has at least one child element
|
static Transformer |
getTransformer() |
static TransformerFactory |
getTransformerFactory() |
static void |
removeNextSiblingText(Element element)
Removes any next siblings text nodes
|
static void |
removePreviousSiblingText(Element element)
Removes any previous siblings text nodes
|
static void |
replaceWith(Node oldNode,
Node newNode)
Replaces the old node with the new node
|
static void |
save(Document document,
File file) |
static void |
setTransformer(Transformer transformer) |
static void |
setTransformerFactory(TransformerFactory transformerFactory) |
static String |
toXml(Document document) |
public static void save(Document document, File file) throws FileNotFoundException, TransformerException
public static String toXml(Document document) throws TransformerException
TransformerException
public static Transformer getTransformer() throws TransformerConfigurationException
public static void setTransformer(Transformer transformer)
public static TransformerFactory getTransformerFactory()
public static void setTransformerFactory(TransformerFactory transformerFactory)
public static void detach(Node node)
public static void replaceWith(Node oldNode, Node newNode)
public static void removePreviousSiblingText(Element element)
public static void removeNextSiblingText(Element element)
public static Element firstChild(Element element, String name)
Copyright © 2011–2015 Red Hat. All rights reserved.