public class XmlUtil extends Object
| Constructor and Description |
|---|
XmlUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
appendElement(Element parentEle,
String name,
Object value) |
static Document |
createDocument() |
static Node |
findfirstNode(Node pNode,
String xpath) |
static Boolean |
findfirstNodeBooleanValue(Node pNode,
String xpath) |
static Double |
findfirstNodeDoubleValue(Node pNode,
String xpath) |
static Integer |
findfirstNodeIntValue(Node pNode,
String xpath) |
static String |
findfirstNodeStringValue(Node pNode,
String xpath) |
static NodeList |
findNodeList(Node pNode,
String xpath) |
static Document |
readDocumentFromFile(File xmlFile) |
static Document |
readDocumentFromStr(String xmlStr) |
static String |
toXmlString(Document document) |
static void |
write2File(File xmlFile,
Document document) |
public static Document createDocument() throws ParserConfigurationException
ParserConfigurationExceptionpublic static Document readDocumentFromStr(String xmlStr) throws ParserConfigurationException, IOException, SAXException
public static Document readDocumentFromFile(File xmlFile) throws ParserConfigurationException, IOException, SAXException
public static String toXmlString(Document document) throws TransformerException
TransformerExceptionpublic static void write2File(File xmlFile, Document document) throws TransformerException, IOException
TransformerExceptionIOExceptionCopyright © 2025. All rights reserved.