i'm creating an XmlDocument using c#. the code looks about like this:
myXmlElement = XmlDocument.CreateElement("prefix", "name", "uri");
ParentElement.AppendChild(myXmlElement);
the xml structure is supposed to look about like this:
<root xmlns:ns1="uri1" xmlns:ns2="uri2" xmlns:ns3="uri3">
<ns1:a/>
<ns2:b/>
<ns3:c/>
</root>
unfortunately what i get is something like this:
<root>
<ns1:a xmlns:ns1="uri1"/>
<ns2:b xmlns:ns2="uri2"/>
<ns3:c xmlns:ns3="uri3"/>
</root>
how can i advise the XmlDocument that the namespace is supposed to be declared on a parent node? this way the declaration gets repeated for every node what blows up the document size for no reason.
thx in advance, best regards
myXmlElement = XmlDocument.CreateElement("prefix", "name", "uri");
ParentElement.AppendChild(myXmlElement);
the xml structure is supposed to look about like this:
<root xmlns:ns1="uri1" xmlns:ns2="uri2" xmlns:ns3="uri3">
<ns1:a/>
<ns2:b/>
<ns3:c/>
</root>
unfortunately what i get is something like this:
<root>
<ns1:a xmlns:ns1="uri1"/>
<ns2:b xmlns:ns2="uri2"/>
<ns3:c xmlns:ns3="uri3"/>
</root>
how can i advise the XmlDocument that the namespace is supposed to be declared on a parent node? this way the declaration gets repeated for every node what blows up the document size for no reason.
thx in advance, best regards