XQuery/Executing a script

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Execution Methods[edit]

If you are using the oXygen IDE this can be done by selecting the "transform" icon on the toolbar.

If you are running this program in the eXist databases you can upload a file called helloWorld.xq using the "Browse" function in the web administrator and then run the following in the browser:

http://localhost:8080/exist/rest/db/helloWorld.xq

There are three important items to note in this URL.

  1. This is the URL that you would use if you used the default eXist configuration
  2. Note that the word "rest" is in the URL before the "/db" indicating that you are using the REST interface (as opposed to the WebDAV, Atom or SOAP interface)
  3. Note that the port is "8080" (the default port for development web sites) and that the "context" of the server is "exist". Both of these can be easily changed by editing the $EXIST_HOME/tools/jetty/etc/conf.xml file and restarting your eXist server. The short-form on production sites might be:

http://localhost/rest/db/helloWorld.xq

With tools like URL rewriting you can also remove the "/rest" and the "/db" components of the URL.