Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

import org.w3c.dom.Document;

import org.w3c.dom.NodeList;

public class Main {
    /**
     * @param doc
     * @param expr
     * @return
     * @throws XPathExpressionException
     */
    public static NodeList findNodes(Document doc, XPathExpression expr) throws XPathExpressionException {
        Object evaluate = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) evaluate;
        return nodes;
    }
}