12

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

How can I add a root element like:

 book:aaaa xsi:schemalocationchemaLocation="http://www.com"
1
  • 1
    And the example code in the MSDN documentation doesn't help? Commented Jun 18, 2010 at 13:32

1 Answer 1

19
XmlDocument doc = new XmlDocument();
XmlElement elem = doc.CreateElement("book", "aaaa", "http://www.com");
doc.AppendChild(elem);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.