ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jayant Vaish <jayantvai...@gmail.com>
Subject Custom xpath function is executed twice
Date Fri, 01 Jun 2012 08:34:16 GMT

Custom xpath function is executed twice because:-

In
org.apache.ode.bpel.elang.xpath20.runtime.XPath20ExpressionRuntime.evaluate(OExpression
cexp, EvaluationContext ctx) throws FaultException, EvaluationException{
     .....
      try {
            someRes = evaluate(cexp, ctx, XPathConstants.NODESET);
        } catch (Exception e) {
            someRes = evaluate(cexp, ctx, XPathConstants.STRING);
        }
    ....

}


evaluate(cexp, ctx, XPathConstants.NODESET); is responsible to call the
custom xpath function, but that function return type is boolean.
So, it throws exception:
org.apache.ode.bpel.explang.EvaluationException: Error while executing an
XPath expression: net.sf.saxon.trans.XPathException: Extension function
required class org.w3c.dom.NodeList; supplied value of class
net.sf.saxon.value.BooleanValue could not be converted. (As result is not
able to converted into specified type i.e. NODESET)

Then in the catch block it again call the custom xpath function.

Is their any way to avoid calling custom xpath function twice or if there is
any way to get the return type of custom xpath function based on that value
we can set the type.

Thanks in Advance.
-- 
View this message in context: http://old.nabble.com/Custom-xpath-function-is-executed-twice-tp33943437p33943437.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message