Java 怎么从xpathfactory获取xpath

2019年7月29日20:58:07Java 怎么从xpathfactory获取xpath已关闭评论 441 350字阅读1分10秒

1.简介

Java 怎么从xpathfactory获取xpath?——请看下文。

2.示例代码

/**
 * 版权所有 编程十万个怎么办(www.tah1986.com)
 */



import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getXpath());
    }

    public static XPath getXpath() {
        XPathFactory newInstance = XPathFactory.newInstance();
        return newInstance.newXPath();
    }
}

 
编程十万个怎么办