Incomplete XML attribute

后端 未结 2 517
挽巷
挽巷 2021-01-20 03:14

I am creating XML out of Dataset by dataset.GetXML() method. I want to add attributes to it

            XmlAttribute attr = xmlObj.CreateAttri         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-20 03:53

    You need to specify the prefix separately, not as part of the name. There is no overload that takes just a prefix and the name, so you have to use the overload that also takes a namespace, and use null for the namespace:

    attr = xmlObj.CreateAttribute("xsi", "schemaLocation", null);
    

提交回复
热议问题