Core functions
Brought to you by:
kdgregory
Hi,
I am testing the XPathWraper and have a problem by using core functions.
private XPathWrapperFactory wrapperFactory = new XPathWrapperFactory() .bindNamespace("bpmn", "http://www.omg.org/spec/BPMN/20100524/MODEL") .bindNamespace("form", "http://www.bpsim.org/schemas/1.0"); Document dom = ParseUtil.parse(new File("Model/Test3.bpmn")); XPathWrapper xpw = wrapperFactory.newXPath("../../../../../../../name()"); result = xpw.evaluateAsString(dom);
and I get:
Exception in thread "main" net.sf.practicalxml.XmlException: unable to compile: ../../../../../../../name()
What is wrong? must I bind the core functions?
Christian
This is actually a limitation of the JDK, and perhaps of the XPath 1.0 expression syntax (although I've been looking at the BNF to determine just how a LocationPath is a special case of an Expr, and am not finding anything clear -- I would have expected a
LocationPath
to be one of thePrimaryExpr
forms, but it isn't).Regardless, it isn't an issue with binding. Here are some examples:
Last edit: Keith D Gregory 2017-06-23