Code example for XPathExpression

Methods: evaluate

0
	public static NodeList evaluateXPath(Object item, String path) {
	    try { 
			XPathFactory factory = XPathFactory.newInstance();
			XPath xpath = factory.newXPath();
			XPathExpression expr = xpath.compile(path);
			return (NodeList)expr.evaluate(item, XPathConstants.NODESET);
	    } catch (Exception e) {
	    	return null; 
	    } 
	} 
 
	public static boolean osWindows() { 
		return System.getProperty("os.name").toLowerCase().startsWith("windows");
	} 
 
	public static String tempPath() {
		return System.getProperty("java.io.tmpdir");
	} 
 
	//	used in xsl scripts 
	public static String tempPath(String subdir, String name) {