Search in sources :

Example 6 with XPathFunctionException

use of javax.xml.xpath.XPathFunctionException in project nokogiri by sparklemotion.

the class NokogiriXPathFunction method evaluate.

public Object evaluate(List args) throws XPathFunctionException {
    if (args.size() != this.arity) {
        throw new XPathFunctionException("arity does not match");
    }
    final Ruby runtime = this.handler.getRuntime();
    ThreadContext context = runtime.getCurrentContext();
    IRubyObject result = RuntimeHelpers.invoke(context, this.handler, this.name, fromObjectToRubyArgs(runtime, args));
    return fromRubyToObject(runtime, result);
}
Also used : XPathFunctionException(javax.xml.xpath.XPathFunctionException) ThreadContext(org.jruby.runtime.ThreadContext) IRubyObject(org.jruby.runtime.builtin.IRubyObject) Ruby(org.jruby.Ruby)

Aggregations

XPathFunctionException (javax.xml.xpath.XPathFunctionException)6 ArrayList (java.util.ArrayList)4 QName (javax.xml.namespace.QName)4 TransformerException (javax.xml.transform.TransformerException)4 XPathFunction (javax.xml.xpath.XPathFunction)4 XNodeSet (org.apache.xpath.objects.XNodeSet)4 XObject (org.apache.xpath.objects.XObject)4 Ruby (org.jruby.Ruby)2 ThreadContext (org.jruby.runtime.ThreadContext)2 IRubyObject (org.jruby.runtime.builtin.IRubyObject)2