2

I have been trying simple REST call with XQIB. My attempt is only more simplified example (http://www.xqib.org/js/RESTCallCourses_source.html), but I can't get to run neither of them. I get the same error in both cases:

MXQuery output the following error during compilation: Line 8, Column 12: err:XPST0017 Function named http-client:send-request with arity 1 not available

It must be something obvious, but I can't figure it out. Here is my code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>   
    <title>Sample</title>
    <meta charset="UTF-8"/>
    <script type="text/javascript" src="mxqueryjs/mxqueryjs.nocache.js"></script>
    <script type="application/xquery">
      declare namespace http-client = "http://expath.org/ns/http-client";

        for $x in http-client:send-request
          (
            <http-client:request href="http://www.fi.muni.cz/~xprazak2/xqib/samplefires.xml" method="get"/>
          )//*:street
        return
          insert node
            <p>{$x/*:street/data(.)}</p>
          as last into b:dom()//body     
    </script>
  </head>
  <body>
    <h1>Will it work?</h1>    
  </body>
</html>

I even tried functions with different arities (http://www.zorba-xquery.com/html/modules/expath/http-client), same error. Has anyone encountered this before?

4

1 回答 1

0

Seems like a bug to me. It is definitely in the spec and I also tried with another XQuery processor, where this query works fine. I also tried using xqib and got the same error. Looks to me like the version used in there demo is more up-to-date than what is in the svn or you have to build it yourself with some special parameters

于 2014-06-25T00:28:07.147 回答