On 15/01/2014, Christian GrĂ¼n <christian.gruen@gmail.com> wrote:
This should help:
function page:bookstore($x)
I tried: ... function page:bookstore($x) as element(bookstore) { <bookstore> { let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[contains(text(),'Everyday Italian')]/parent::* return $x } </bookstore> }; The result: HTTP ERROR 404 Problem accessing /. Reason: No function found that matches the request. Powered by Jetty:// Then I tried: ... function page:bookstore($x) {... which produces the same error result shown above. Then tried: ... function page:bookstore($x) <bookstore> { let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[contains(text(),'Everyday Italian')]/parent::* return $x } </bookstore> The result: HTTP ERROR 400 Problem accessing /. Reason: Stopped at /path/to/webapp/restxq.xqm, 59/2: [XPST0003] Expecting '{', found '<'. Powered by Jetty:// What next must I try, please?