本文整理了Java中org.dom4j.Node.createXPath()
方法的一些代码示例,展示了Node.createXPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.createXPath()
方法的具体详情如下:
包路径:org.dom4j.Node
类名称:Node
方法名:createXPath
[英]createXPath
creates an XPath object for the given xpathExpression. The XPath object allows the variable context to be specified.
[中]
代码示例来源:origin: pentaho/pentaho-kettle
XPath xpathField = node.createXPath( addNSPrefix( XPathValue, data.PathValue ) );
xpathField.setNamespaceURIs( data.NAMESPACE );
if ( xmlDataField.getResultType() == GetXMLDataField.RESULT_TYPE_VALUE_OF ) {
代码示例来源:origin: dom4j/dom4j
protected void testXPath(Node node, String xpathText) {
XPath xpath = node.createXPath(xpathText);
Object object = xpath.evaluate(node);
}
}
代码示例来源:origin: dom4j/dom4j
protected void testXPath(Node node, String xpathExpr) throws Exception {
try {
XPath xpath = node.createXPath(xpathExpr);
String value = xpath.valueOf(node);
log("valueOf: " + xpathExpr + " is: " + value);
} catch (Throwable e) {
e.printStackTrace();
assertTrue("Failed with exception: " + e, false);
}
}
}
代码示例来源:origin: dom4j/dom4j
protected void testXPath(Node node, String xpathText) throws Exception {
try {
XPath xpath = node.createXPath(xpathText);
Number number = xpath.numberValueOf(node);
log("Searched path: " + xpathText + " found: " + number);
} catch (Throwable e) {
log("Caught exception: " + e);
e.printStackTrace();
assertTrue("Failed to process: " + xpathText
+ " caught exception: " + e, false);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!