This is the code to make the startelement of the XML:
writer.WriteStartElement("LIEFERUNG-AUSWI", "http://www.bundesbank.de/xmw/auswi/2013-01-01");
writer.WriteAttributeString("xmlns", "aw", null, "http://www.bundesbank.de/xmw/auswi/2013-01-01");
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xmlns", "bbk", null, "http://www.bundesbank.de/xmw/2003-01-01");
writer.WriteAttributeString("xsi", "schemaLocation", null, "http://www.bundesbank.de/xmw/auswi/2013-01-01 BbkXmwAuswi_2013.xsd");
writer.WriteAttributeString(null, "version", null, "1.0");
writer.WriteAttributeString(null, "erstellzeit", null, Dat_DatZeit);
writer.WriteAttributeString(null, "stufe", null, "Produktion");
The output is this:
<LIEFERUNG-AUSWI xmlns:aw="http://www.bundesbank.de/xmw/auswi/2013-01-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bbk="http://www.bundesbank.de/xmw/2003-01-01" xsi:schemaLocation="http://www.bundesbank.de/xmw/auswi/2013-01-01 BbkXmwAuswi_2013.xsd" version="1.0" erstellzeit="2013-12-05T14:39:37" stufe="Produktion" xmlns="http://www.bundesbank.de/xmw/auswi/2013-01-01">
What can I do to change the order so that the xmlns
attribute is the first one? It should be like this:
<LIEFERUNG-AUSWI xmlns="http://www.bundesbank.de/xmw/auswi/2013-01-01" xmlns:aw="http://www.bundesbank.de/xmw/auswi/2013-01-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bbk="http://www.bundesbank.de/xmw/2003-01-01" xsi:schemaLocation="http://www.bundesbank.de/xmw/auswi/2013-01-01 BbkXmwAuswi_2013.xsd" version="1.0" erstellzeit="2013-12-05T14:39:37" stufe="Produktion">
This Question is the same but there was no answer: Write xmlns element with attributes