Skip to content

Namespace for Reading Xml?

Drew Taylor

Asked Jun 14, 2007, 4:59 AM EDT3 answers
Share
LinkedInX

What namespace do you need when using xdocument to read xml?

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    You mean XmlDocument? It is in System.Xml. You may also have to add reference to assembly.
    Here is code snippet:

     System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
        doc.Load(Server.MapPath("MySource.xml"));
        System.Xml.Xsl.XslTransform trans = new
           System.Xml.Xsl.XslTransform();
        trans.Load(Server.MapPath("MyStyle.xsl"));
        Xml1.Document = doc;
        Xml1.Transform = trans;
    0
  • 0

    I used System.Xml / System.Xml.XPath but got a node out of range error. I am trying to get a specific node / tag in the xml and display it in a textbox.

    0
  • 0
    What does your code look like?
    0