Hi,
My question is how do you create a new database in restxq?
When trying to create a db I get the error msg:
HTTP Error 400
[XUST0001] element constructor: no updating expression allowed.
Some digging around and I learned that I might need the "updating" annotation though even after the change it gives the same error.
My file looks like this now:
=========== File start ================
declare
%rest:path("/start")
%updating
%output:method("xhtml")
%output:omit-xml-declaration("no")
%output:doctype-public("-//W3C//DTD XHTML 1.0 Transitional//EN")
%output:doctype-system("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")
function page:hello()
as element(Q{http://www.w3.org/1999/xhtml}html)
{
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Good day Sir!</title>
<link rel="stylesheet" href="static/w3.css"/>
<time>The current time is: { current-time() }</time>
<body class="w3-container">
<ul class="w3-navbar w3-green">
<li><a href="#">Home</a></li>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>
<ul>{
for $result in db:open('factbook')//continent/@name
return <li>{ data($result) }</li>
}</ul>
<li>
{
db:create("test")
}
</li>
</body>
</html>
=========== File End ================