[xquery-talk] namespace declarations in an element

Florent Georges lists at fgeorges.org
Thu May 26 16:16:04 PDT 2011


David Carlisle wrote:

  Hi,

> the solution is about adding a namespace node to a constructed
> element, that dpesn't lose type information. If the data you
> are outputting is placed into am element attribute or content
> then that's essentially just outputting its string value and
> losing type information unless the constructed element is
> re-validated, but adding a namespace node isn't the cause of
> that loss.

  Well, actually it is, because this solution does not add
namespace declarations to an existing node, but instead returns a
copy of the initial node with some extra namespace declarations.
And if you want to add them to an existing node, you have to copy
it in XQuery 1.0.  Fortunately, in XQuery 3.0, you can add
dynamically generated namespace nodes to an element directly in
its sequence constructor.

  Regards,

-- 
Florent Georges
http://fgeorges.org/





More information about the talk mailing list