On 10/01/2014, e-letter inpost@gmail.com wrote:
On 10/01/2014, Dirk Kirsten dk@basex.org wrote:
Hi,
I don't quite get what you are asking for. All functions within the module should belong to the same namespace. So i.e. you could simply put your bookstore() function into the page namespace (i.e. use "declare function page:bookstore()") or you could place all the functions bound to the page namespace to the book namespace.
changed the namespace function to:
... declare %rest:GET %rest:path("xmldatabasefile.xml/bookstore/book") %rest:form-param("booktitle", "$x") %rest:produces("text/html") %output:method("xhtml") function page:bookstore() as element(bookstore) { <bookstore> { let $x := fn:doc("xmldatabasefile.xml")/bookstore/book/title[contains(text(),'Everyday Italian')]/parent::* return $x } </bookstore> };
The server response:
HTTP ERROR 400
Problem accessing /. Reason: Stopped at /path/to/webapp/restxq.xqm, 58/10: [BASX0003] Invalid path template: "$x".
Powered by Jetty://