public abstract class XmlUtil extends Object
| 构造器和说明 |
|---|
XmlUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
findValueByAttrName(org.apache.commons.configuration.tree.ConfigurationNode node,
String attrName)
通过属性名得到属性的值
|
static Element |
getElementByTagName(Document doc,
String tagName)
通过标签名得到第一个元素
|
static String |
getElementValue(Element element)
得到元素的值
|
static org.apache.commons.configuration.tree.ConfigurationNode |
getFirstNodeByNodeName(org.apache.commons.configuration.tree.ConfigurationNode node,
String name)
通过名称得到指定节点下第一个元素
|
static Object |
getValueByXpath(Object beanObj,
String xpath)
通过xpath方式得到对象中的值
|
static XMLReader |
getXMLReader() |
static Document |
parserDocment(String src)
解析XML文档
|
public static XMLReader getXMLReader()
public static final Document parserDocment(String src) throws ProjectException
src - 要解析的字符串ProjectException - 解析错误public static Element getElementByTagName(Document doc, String tagName)
doc - 文档tagName - 标签名public static final String findValueByAttrName(org.apache.commons.configuration.tree.ConfigurationNode node, String attrName)
node - 含有属性的节点attrName - 属性名public static String getElementValue(Element element)
element - 文档元素public static final org.apache.commons.configuration.tree.ConfigurationNode getFirstNodeByNodeName(org.apache.commons.configuration.tree.ConfigurationNode node,
String name)
node - 指定节点name - 子节点名称Copyright © 2015. All rights reserved.