Some Sausalito application that used to work on 1.4.4 generates XHTML. Here is a small sample of what it did:
module namespace def="
http://www.example.com/Test/default";
import module namespace http="
http://www.28msec.com/modules/http";
declare sequential function def:index()
{
http:set-content-type("application/xhtml+xml"),
<html xmlns="
http://www.w3.org/1999/xhtml">
<body>ok</body>
</html>
};
Above is the 1.4.4 version. For converting it to 2.2, I changed the 'sequential' annotation and switched to using the 'response' module:
module namespace def="
http://www.example.com/Test/default";
import module namespace resp="
http://www.28msec.com/modules/http/response";
declare %an:sequential function def:index()
{
resp:set-content-type("application/xhtml+xml"),
<html xmlns="
http://www.w3.org/1999/xhtml">
<body>ok</body>
</html>
};
However I have problems getting that to work, because it results in this error message:
SEPM0009 - omit-xml-declaration parameter is "yes" and the version parameter has a
value other than "1.0" and the doctype-system parameter is specified
Now I am fine with XQuery 1.0, so I tried to specify
xquery version "1.0"
But no success - now it does not let me import the response module:
XQST0031 - "3.0": XQuery library version can not be imported by a 1.0 version module
Some documentation research led me to the assumption that I would have to use
resp:set-serialization-parameters(resp:serializer-defaults-xhtml())
instead of just setting the content type. But this did not make a difference.
What can I do to convert my application to 2.2?
Thanks
Gunther