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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Read XML

Read XML

Scheduled Pinned Locked Moved ASP.NET
data-structuresxmlhelp
2 Posts 2 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.
  • V Offline
    V Offline
    Vipin Venugopal
    wrote on last edited by
    #1

    can anyone help me to read the nodes and values of a XML to a multidimensional array.there is only single parent node for my xml page. Vipin

    C 1 Reply Last reply
    0
    • V Vipin Venugopal

      can anyone help me to read the nodes and values of a XML to a multidimensional array.there is only single parent node for my xml page. Vipin

      C Offline
      C Offline
      coolestCoder
      wrote on last edited by
      #2

      Hi Vipin, You can use a For each statement to read all the nodes in an XmlDocument. the XmlDocument will contain the xml data from a file, i guess. You can do something like this- XmlDocument xmlDoc = new XmlDocument(); int i=0; string[] arrString = new string[20]; XmlNode tempNode, xn; xmlDoc.Load("c:\sample.xml"); xn = doc.DocumentElement; ForEach(tempNode In xn.ChildNodes) arrString[i] = tempNode.InnerText; i++; Next doc.Save("c:\sample.xml"); Hope this helps. The code i wrote is not compiled. tell me if gives some error, i will correct it.


      "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


      Anant Y. Kulkarni

      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