创建命名空间我有添加新节点(命名空间),其用于生成XAML我的xml文件的问题。我这样做:的XML元素
XmlElement richTextColumns = xmlDoc.CreateElement("local2:RichTextColumns");
但我收到错误0xC00CE01D(同时调用xmlDoc.getxml)。我已经尝试添加属性的xmlns:local2 =“使用:App2.Common”到xmlDoc中:
var att = xmlDoc.CreateAttribute("xmlns:local2");
att.InnerText = "using:Dictionary.Common";
xmlDoc.Attributes.SetNamedItem(att);
它导致该错误
对象引用不设置为一个对象的一个实例。
预先感谢您:)
在Win8中没有xmlDoc.CreateElement是需要3个ARGS:/ – 2012-08-06 15:55:51
什么XML API您使用的?我假设你正在使用'System.Xml.XmlDocument'。 – Dan 2012-08-06 15:59:16
“存在的system.xml没有System.Xml.XmlDocument”:/ – 2012-08-06 16:02:25