Adam Patterson wrote:
Hi,
> I call a function in one Xquery module from another then the
> returned node always has the empty namespace (xmlns=””) inserted
> into it. Is there a way to stop this behaviour?
Most probably, you have something like:
declare function local:g() {
<elem/>
};
<result xmlns="ns-uri"> {
local:g()
}
</result>
That means you build an XML tree with the binding {default
prefix} -> {some uri}, and introduce somewhere within it an
element within no namespace. So the serializer has no other
choice than undeclaring the default prefix to respect what you
asked it to produce.
If you want the inner element to be in the same namespace, you
have to produce it in the same namespace. One of the several
possible solutions:
declare function local:g() {
<elem xmlns="ns-uri"/>
};
<result xmlns="ns-uri"> {
local:g()
}
</result>
Regards,
--
Florent Georges
http://fgeorges.org/
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general