[xquery-talk] namespace declarations in an element

Ghislain Fourny gfourny at inf.ethz.ch
Thu May 26 07:23:33 PDT 2011


Hi Leo,

In XQuery 3.0 you have namespace node constructors which might be what you are looking for.

Or you can also simply build the elements a:test, b:test, c:test just like the root element and let the serializer do the job, but the namespace declarations might not end up at the same place in the output document.

I hope this helps.

Kind regards,
Ghislain


On May 26, 2011, at 4:14 PM, Leo Studer wrote:

> Hi Michael and Ghislain
> 
> thank you for your input. Indeed with those two functions I get the prefixes and the namespaces as I need them.
> 
> Now a related question. How do I generate such namespaces in an element with xQuery?
> 
> <root xmlns:a="http://a.ch" xmlns:b="http://b.ch" xmlns:c="http://c.ch" xmlns="http://test.ch">
>    <a:test/>
>    <b:test/>
>    <c:test/>
> </root>
> 
> to create root with a namespace I do with 
> element{QName("http://test.ch", "root")}{...}
> 
> but how to get other namespace declarations in an element I ignore.
> 
> Thanks again for caring
> Leo
> 
> 
> 
> 
> 
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk




More information about the talk mailing list