public class XmlUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Element |
addChildElement(Node parent,
String elementName) |
static Element |
addChildElement(Node parent,
String elementName,
String textContent) |
static Element |
firstChild(Element element,
String name)
Returns the first child element for the given name
|
static String |
firstChildTextContent(Element element,
String name) |
static Document |
parseDoc(File xmlFile) |
static void |
removeChildren(Element element) |
static void |
save(Document document,
File file) |
public static Document parseDoc(File xmlFile) throws ParserConfigurationException, SAXException, IOException
public static Element firstChild(Element element, String name)
public static void removeChildren(Element element)
public static Element addChildElement(Node parent, String elementName, String textContent)
public static void save(Document document, File file) throws FileNotFoundException, TransformerException
Copyright © 2021. All rights reserved.