1

我需要验证字符串 xpath 表达式中的数据。

SimpleVariableContext svc=new SimpleVariableContext();
svc.setVariableValue("part1", xpathBodyElements[0]);
String completedXPath="$part1";
BaseXPath  contextpath=new BaseXPath(completedXPath,nav);
contextpath.setVariableContext(svc);

现在我有了经过验证的 Xpath 对象。我有一个包含 xml 结构的 OMElement。我想获取 basexpath 中定义的特定元素。如何使用 BaseXPath 对象访问 OMElement?

我可以将 BaseXpath 对象转换为 AxiomXPAth 元素吗?

4

0 回答 0