问题
I'm trying to create a really basic web app that lets a user upload an xml file with a form, runs an XQuery script which I already have written as a function, and returns the result. I have BaseX running on Tomcat, but for the life of my I cannot understand RESTXQ even though I have a lot of experience with complex XQuery scripts. The BaseX documentation has been no help (http://docs.basex.org/wiki/RESTXQ). What is the basic architecture?
From what I can see, its all keyed on this restxq.xqm file in the webapp directory. If you link to that directory it runs the .xqm file and this is mandated by a web.xml file. But it seems that all of the html sections are also stored within this restxq.xqm file. Wouldn't it make sense so store html sections in separate files for maintenance/reusability?
Also, for my file upload form, do I have the action attribute point to restxq.xqm? I can make the pages all static html since the app is so simple, but where is the index.html file go? This seems WAY more confusing than it has to be.
来源:https://stackoverflow.com/questions/25124130/how-do-i-use-restxq-with-basex-for-a-simple-web-app