How do I use RESTXQ with BaseX for a simple web app?

耗尽温柔 提交于 2020-07-22 12:19:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!