/**
* Evaluates provided XPath expression into the {@link String}
*
* @param evalExpression Expression to evaluate
* @param xmlSource XML source
* @return Evaluation result
*/
public static String evaluateXPathToString(String evalExpression,
String xmlSource) {
try {
return XPathFactory.
newInstance().
newXPath().
evaluate(
evalExpression,
DocumentBuilderFactory.
newInstance().
newDocumentBuilder().
parse(new InputSource(
new StringReader(
xmlSource))));
} catch (Exception e) {
LOG.warning(COMMON_EVAL_ERROR_MESSAGE);
}
return EMPTY;
}
EvaluationUtils.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:trust-java
作者:
评论列表
文章目录