verwendetes Datenbanksystem: <XML>
Hallo. Ich will ein neues Element in ein XML-Dokument einfügen, dass folgendermaßen aussehen soll:
XML-Daten
1:
| <fdt:CommunicationError communicationError="timeout" tag="meinTag"/> |
Ich dachte, das ginge mit folgendem Code:
C#-Quelltext
1: 2: 3: 4:
| XmlElement error = xdoc.CreateElement("fdt:CommunicationError");error.SetAttribute("communicationError", "timeout"); error.SetAttribute("tag", "meinTag"); elem1.AppendChild(error); |
Aber was dabei herauskommt ist:
XML-Daten
1:
| <CommunicationError communicationError="timeout" tag="meinTag"/> |
also ohne das "fdt" und den Doppelpunkt! Also verschluckt er irgendwo das Namespace-Prefix. Warum??
Wie mache ich das denn, dass das mit eingefügt wird?!?
Danke!