[英]XForms and restxq application
我正在尝试创建一个简单的界面,该界面将使用XForms显示“ Drop a Database”按钮。 然后,我希望能够调用一个名为dropdatabase.xqm
的RestXQ文档,该文档在单击表单上的按钮时被调用。 我正在使用BaseX。 我将XForm保存在basex/webapp/static
文件夹中名为onlydel.xml
的文件中。 我创建了名为dropdatabase.xqm的RestXQ程序,并将其保存到我的basex/webapp
文件夹中。 我创建了一个名为数据库patients
。
xforms : onlydel.xml
的内容是:
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<?xsltforms-options debug="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<head>
<title>XFORMS IN XHTML</title>
<model xmlns="http://www.w3.org/2002/xforms" id="order-model">
<instance>
<soap xmlns="">
</soap>
</instance>
<submission action="/dropdatabase" method="post" id="s06"/>
</model>
</head>
<body>
<h2>DATABASE</h2>
<div style="float:center;">
<fieldset style="width:50%">
<xf:submit submission="s06"><xf:label>Drop A Database</xf:label></xf:submit>
</fieldset></div>
</body>
</html>
RestXQ:的内容dropdatabase.xqm
是:
module namespace _ = 'http://exquery.org/ns/restxq';
(:~
: Deletes the blog database and redirects the user to the main page.
:)
declare
%restxq:path("/dropdatabase")
%restxq:GET
function _:dropdatabase()
{
(db:drop("patients"))
};
运行此命令时,出现以下错误:
Stopped at /home/ubuntu/basex/webapp/dropdatabase.xqm, 10/13:
[XUST0001] StaticFunc expression: no updating expression allowed.
我需要的帮助是:
错误消息对我来说似乎很清楚: db:drop()
是一个更新表达式,因此在这一点上是不允许的。 您必须使用%updating
批注将功能标记为更新功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.