Hi Philippe,
I would like to know best practices for using RESTXQ for pure XML Web services, in my case AtomPub.
as RESTXQ is still pretty fresh, and as BaseX is still the first implementation (the one from eXist will follow soon, thanks to Adam!), it’s probably too early to talk about best practices. Still, comments from other users are welcome of course!
First I was surprised that using "rest:produces" in the following line did not produces the specified media-type. But instead "application/xml" rest:produces("application/atomsvc+xml") What was necessary was to use 'output:media-type("application/atomsvc+xml")' in addition. Why that?
I agree that the meaning of "produces" can be misleading. This is actually caused by the original HTTP specification, and not RESTXQ itself. I've revised some paragraphs of our still sketchy documentation to make this more explicit. Next, I have added a section which demonstrates the use of serialization parameters within RESTXQ function calls [1].
I would like to know if I should not use the namespace "page" in order to generate my responses knowing that I will produce only XML responses.
The module namespace and its prefix is completely arbitrary; it can even equal the "rest" namespace.
Many BaseX distributions (such as the ZIP package) include some simple RESTXQ example code, which you may use as inspiration. For further information, please consult Adam’s original RESTXQ papers and slides, which are linked from our RESTXQ documentation.
Hope this helps, Christian