Skip to Content
0
Former Member
Oct 23, 2006 at 04:45 PM

Unnecessary Namespace declarations

15 Views

Hi,

When mapping (graphic) to an externally defined XML schema where some elements belong to different namespaces I get namespace declarations on each element in the resulting XML instance even though they refer to the same ns name. The problem is that the XML document, even though valid, is very verbose. Is there a way to get all ns declarations in the root element instead without using XSLT?

Example output

<?xml version="1.0" encoding="utf-8" ?>

http://foo.com">

http://junk.com" />

http://junk.com" />

http://junk.com" />

</ns1:RootElement>

I would like to get something like this instead:

<?xml version="1.0" encoding="utf-8" ?>

http://foo.com" xmlns:ns2=" http://junk.com">

<ns2:Element1 />

<ns2:Element2 />

<ns2:Element3 />

</ns1:RootElement>

Kind regards Johan