开发者

add a root element using xmldocument in C#.net

开发者 https://www.devze.com 2023-01-04 11:23 出处:网络
I need to create an XML file using an xmldocument object in C#. How can I adda root element like: book:aaaa xsi:schemalocat开发者_如何学JAVAionchemaLocation=\"http://www.com\"

I need to create an XML file using an xmldocument object in C#.

How can I add a root element like:

 book:aaaa xsi:schemalocat开发者_如何学JAVAionchemaLocation="http://www.com"


XmlDocument doc = new XmlDocument();
XmlElement elem = doc.CreateElement("book", "aaaa", "http://www.com");
doc.AppendChild(elem);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号