how to create a xml document

hello
i need to create an xml document whith c#
and display it in page pane which contains navigator




Answer this question

how to create a xml document

  • N2O

    Ok so you need to create the document. Then you will need to add a child node to it. You can hang child nodes off the documentelement the same way.

    XmlDocument doc = new XmlDocument();

    doc.DocumentElement = doc.CreateElement("documentroot");

    doc.DocumentElement.AppendChild( doc.CreateElement("myElement"));

    That should get you moving. Do you have any more specific questions



  • Citrus

    You want to look at the XmlDocument class. It's an in memory representation of an xml document based on XMLDOM (worth reading about), which stores the xml information as a tree structure. You can use the XmlDocument class to load/write/query xml, and you can use it to create new nodes (elements, attributes, etc)

    Read up on this class and how to use it on the MSDN library as there's a lot to it, more than a reply can cover. Hopefully that should get you started. Although I would recommend not worrying about how to display it until you understand the basics of how the XmlDocument class works, which again I recommend you reading about XMLDOM.



  • how to create a xml document