I've read on namespaces and tried a default namespace on element as Michael suggested declare default element namespace "http://www.w3.org/2005/Atom"; But RESTXQ raise an error that I didn't have before I declared it: [REXQ9999] Variable $category is not specified as argument. In fact it seems to raise on the first function that use a variable in the annotation. The variable is really passed as an argument, but I suspect that the argument is in my default namespace and so it is not "seen" by RESTXQ. This is the function that created the error: declare %rest:path("/categories/{$category}") %rest:GET %rest:produces("application/atomcat+xml") %output:omit-xml-declaration("no") %output:media-type("application/atomcat+xml") function page:category($category as xs:string) { Am I forgetting something? Thanks, -- Philippe On Fri, May 25, 2012 at 9:04 AM, Christian Grün <christian.gruen@gmail.com> wrote:
Do I really need to declare a default namespace or can I just use namespace everywhere in my code and it will be ok?
Defining a default namespace is just one option; it's completely ok to declare namespace and attach them to prefixes. You may as well use the new XQuery 3.0 notation:
Q{http://my.namespace.org/optional/path}my-function() ...
Hth, C.