Display Xquery (.xq) files in a browser

I am new to programming and very new to xml / xquery

I have a .xq file (with html and xquery code) and .xml (for storing data).

During testing, I can see how the .xq page will be displayed using the studio, but I can not get the page to work using the web server or web hosting. I know this is not unusual, but I could not decide how to fix it (or even if it is possible).

In the meantime, I am using Saxon, which works well, but it is not necessary to use command line code that is completely separate for the application.

I also read that Jedit is an option, but I could not get xquery / saxon plugins to work with xquery. I also wondered if a stylesheet could be used, but couldn't find anything on this.

So, the first question: is it possible for the browser (i.e. using the web host) to display the .xq file? As well as any recommendations for other software?

+4
source share
2 answers

If your goal is to access and execute your XQuery programs through a web browser, you will need an XQuery engine with a web server. There are a number of such products. I personally use and can recommend eXist-db , a free, native, open source XML database. In addition to efficiently storing, indexing and querying your XML, eXist-db works by default with a lightweight web server, which allows you to access your queries through your browser, for example, http: // localhost: 8080 / exist / apps / myapp / myquery.xq . Accessing this URL will cause eXist-db to search for your query (myquery.xq) in the "myapp" directory of the database and, assuming that it does exist, eXist-db will execute the query and serialize the results in the browser. This is a pretty powerful combination - XQuery and its own XML database + web server such as eXist-db. Feel free to read more about eXist-db documentation and ask questions about eXist-db on an exist-open mailing list . Good luck

+2
source

As Joe says, you need a web application framework capable of executing XQuery code. The most obvious choice is any type of XML database that comes with the web server. One example is eXist-db. MarkLogic ( www.marklogic.com ) - more. There is also Sausalito ( www.28msec.com ), which comes with an Eclipse-based developer environment that allows local testing on a small web server. You can also learn ServletX ( www.expath.org ), a small web container for executing xslt, xproc, xquery, etc. With a little effort, you could even take something like Cocoon, place the saxon ( www.saxonica.com ) behind it and use it to execute XQuery. All the examples mentioned allow you to run the code for free, even products from commercial suppliers.

NTN!

+1
source

Source: https://habr.com/ru/post/1410774/


All Articles