I am writing xml with c#, here is the xml,
<?xml version="1.0" encoding="utf-16"?>
<game xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</game>
my code goes here:
XmlDocument doc = new XmlDocument();
XmlDeclaration decl = doc.CreateXmlDeclaration("1.0", "UTF-16", null);
doc.AppendChild(decl);
XmlElement game = doc.CreateElement("game");
doc.AppendChild(game);
XmlNode xmldocSelect = doc.SelectSingleNode("game");
//Crteate Attribute
XmlAttribute xmln = doc.CreateAttribute("xmln");
xmln.Value =":xsi="http://www.w3.org/2001/XMLSchema-instance"";
XmlAttribute xmlns = doc.CreateAttribute("xmlns");
xmlns.Value =":xsd="http://www.w3.org/2001/XMLSchema"";
xmldocSelect.Attributes.Append(xmln);
xmldocSelect.Attributes.Append(xmlns);
but because the attributes has http, it doesn't work...anyone know how to write those attributes? Thanks...
xmln, that is the namespace. The name isxsiand value ishttp://....