Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.xpath.XPath;

import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

public class Main {
    /**
     * @param xpathExp
     * @return
     * @throws XPathExpressionException
     */
    public static XPathExpression createXpath(String xpathExp) throws XPathExpressionException {
        XPathFactory xFactory = XPathFactory.newInstance();
        XPath xPath = xFactory.newXPath();

        XPathExpression expr = xPath.compile(xpathExp);
        return expr;
    }
}