restxq

FLWOR query in eXist gives: XML Parsing Error: no root element found

陌路散爱 提交于 2021-02-11 15:14:37
问题 I'm looking to adapt the simplest possible FLWOR possible from BaseX to eXist as below. Error in eXist : XML Parsing Error: no root element found Location: http://localhost:8080/exist/rest/db/scripts/notes.xq Line Number 1, Column 1: Query: xquery version "3.0"; for $note in collection("/db/temp/notes") return $note Collection: <notes> <note> foo </note> <note> bar </note> <note> baz </note> </notes> from BaseX : nicholas@mordor:~/basex$ nicholas@mordor:~/basex$ cat notes.xq xquery version "3

Why does Firefox show: XML Parsing Error: junk after document element?

限于喜欢 提交于 2021-02-11 14:22:57
问题 Error: yet from the console, desired output: nicholas@mordor:~$ nicholas@mordor:~$ curl http://localhost:8080/exist/rest/db/scripts/notes.xq <notes> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> <note> foo </note> <note> bar </note> </notes> <notes> <note> foo </note> <note> bar </note> <note> baz </note> </notes>nicholas@mordor:~$ nicholas@mordor:~$ nicholas@mordor:~$ lynx http://localhost:8080/exist/rest/db/scripts

How to configure a “hello world” HTML page using BaseX with RestXQ?

人盡茶涼 提交于 2021-01-29 16:42:53
问题 More of a usage question than a programming question, in relation to: BaseX RESTXQ "hello world" example How do I use RESTXQ with BaseX for a simple web app? basex/rest - blog complete app Is there a way to make BaseX serve an HTML document? Certainly, it's easy enough to fork the blog app. However, it's also eight years old. The sample from the documentation is: module namespace page = 'http://basex.org/examples/web-page'; declare %rest:path("hello/{$who}") %rest:GET function page:hello($who

Is there a way to make BaseX serve an HTML document?

人盡茶涼 提交于 2020-07-21 03:23:05
问题 Is there a way to make BaseX's HTTP server serve an HTML document stored either in the db as a raw resource or in the file system, with a text/html content type, so it can be displayed in a browser? The document is a web page that does XHR requests to BaseX. Currently, I load it on the browser through the file protocol. This necessitates making Jetty to respond with CORS headers, or else the same origin policy blocks the XHR requests. However, this is a maintenance burden. Every update to

How to authenticate exist-db users in RESTXQ

三世轮回 提交于 2019-12-11 14:35:43
问题 (complete rephrase - since no answer): I am developing an exist-db application with user authentication and RESTXQ. My users log in via the login:set-user function from the login module. Here a snippet from the controller: import module namespace login="http://exist-db.org/xquery/login" at "resource:org/exist/xquery/modules/persistentlogin/login.xql"; declare variable $local:login_domain := "org.exist-db.superApp"; declare variable $local:user := $local:login_domain || '.user'; let $logout :=