I'm using XMLDocument to create a XML file, but when i set an attribute to an element called "xsi:type" in the .xml generated file this attribute is changed to just "type".
This is the output that i'm expecting:
<ODX xsi:type="VALUE" />
This is my code
using System.Xml;
public static void xml_test()
{
XmlDocument doc = new XmlDocument();
XmlDeclaration declaire = doc.CreateXmlDeclaration("1.0", "utf-8", null);
XmlElement ODX = doc.CreateElement("ODX");
ODX.SetAttribute("xsi:type", "VALUE");
doc.AppendChild(ODX);
doc.Save("C:\\Users\\dev\\Pictures\\DocParser\\DocParser\\xml_question_test.xml");
}
This is content of the xml_question_test.xml output file that i get,:
<ODX type="VALUE" />
Notice how change the name of the attribute from "xsi:type" to "type", i tried to set the name of the attribute as literal with @ before the string but it didn't work... i haven't found anything useful...