public class XmlAccessor extends Object
| 构造器和说明 |
|---|
XmlAccessor()
XML中没有指定命名空间,或者只有W3C标准命名空间时,用这个
|
XmlAccessor(String defaultNamespacePrefix)
XML中指定了非标准的命名空间时,用这个
|
public XmlAccessor()
public XmlAccessor(String defaultNamespacePrefix)
public String getDefaultNamespacePrefix()
public void setDefaultNamespacePrefix(String defaultNamespacePrefix)
public void setElementAttribute(Document doc, XPathFactory factory, String elementXpath, String attributeName, String attributeValue) throws Exception
Exceptionpublic void setElementAttributes(Document doc, XPathFactory factory, String elementXpath, Map<String,String> attrs) throws Exception
Exceptionpublic void setElementsAttributes(Document doc, XPathFactory factory, String elementXpath, Map<String,String> attrs) throws Exception
Exceptionpublic String getElementAttribute(String xmlFilePath, String elementXpath, String attributeName) throws Exception
Exceptionpublic String getElementAttribute(Document doc, XPathFactory factory, String elementXpath, String attributeName) throws Exception
Exceptionpublic Node getNode(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public Element getElement(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public Attr getAttr(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public NodeList getNodeList(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public String getString(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public Number getNumber(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
public Boolean getBoolean(Document doc, XPathFactory factory, String elementXpath) throws XPathExpressionException
Copyright © 2020. All rights reserved.