Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. read xml file 'Hello world'

read xml file 'Hello world'

Scheduled Pinned Locked Moved XML / XSL
xmlhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code: private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } } please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

    U P 2 Replies Last reply
    0
    • L Lost User

      i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code: private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } } please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

      U Offline
      U Offline
      User 508833
      wrote on last edited by
      #2

      stupid thing posted when i hit the 'preview' button. here's the xml source: Newco.Controls Summary description for GroupBoxLine. Removes the 'FlatStyle' property for this item. Draws a light dashed line around the control in design view to make it more visible. Custom control to mirror the look of an Office 2003 groupBox. Specifies the color of the line. Specifies the color of the text. Default contructor for the class GroupBoxLine. Overrides the OnPaint event to create the look of Office 2003. Clean up any resources being used. Specifies the color of the line. Specifies the color of the text.

      1 Reply Last reply
      0
      • L Lost User

        i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code: private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } } please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't.

        P Offline
        P Offline
        Philip Fitzsimons
        wrote on last edited by
        #3

        LoadXml expects the string to be the XML you should be using Load(filename)


        "When the only tool you have is a hammer, a sore thumb you will have."

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups