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. How to update a XML file

How to update a XML file

Scheduled Pinned Locked Moved XML / XSL
questioncsharpxmltutorial
4 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
    lasseran
    wrote on last edited by
    #1

    Hi all, I have very newbie question concerning VB.NET and XML. I have an Xml file like this (simplified): 123 John Doe ... 890 Mary Somebody I can extract info from it but I don't know how to update it? Eg. Mary Somebody gets married and her name will be Mary Doe. I will be most grateful any advice or links to info. TIA Lasse Rantanen lasse.rantanen@jopiarvio.fi

    P 1 Reply Last reply
    0
    • L lasseran

      Hi all, I have very newbie question concerning VB.NET and XML. I have an Xml file like this (simplified): 123 John Doe ... 890 Mary Somebody I can extract info from it but I don't know how to update it? Eg. Mary Somebody gets married and her name will be Mary Doe. I will be most grateful any advice or links to info. TIA Lasse Rantanen lasse.rantanen@jopiarvio.fi

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

      in c#... using System.Xml; . . . XmlDocument personnel = new XmlDocument(); personnel.Load(filename); XmlElement marysName = null; marysName = personnel.SelectSingleNode("//person[person_id/text() = '890']/name"); marysName.innerText = "Mary Doe"; personnel.Save(filename);


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

      L 1 Reply Last reply
      0
      • P Philip Fitzsimons

        in c#... using System.Xml; . . . XmlDocument personnel = new XmlDocument(); personnel.Load(filename); XmlElement marysName = null; marysName = personnel.SelectSingleNode("//person[person_id/text() = '890']/name"); marysName.innerText = "Mary Doe"; personnel.Save(filename);


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

        L Offline
        L Offline
        lasseran
        wrote on last edited by
        #3

        Thanks, I have noticed that I usually get stuck with things which have rather simple solution. ;)

        P 1 Reply Last reply
        0
        • L lasseran

          Thanks, I have noticed that I usually get stuck with things which have rather simple solution. ;)

          P Offline
          P Offline
          Peter Weyzen
          wrote on last edited by
          #4

          Often things are not simple nor obvious until you figure them out. Most of this is not too intuitive. Cheers.

          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