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. I'm confused

I'm confused

Scheduled Pinned Locked Moved XML / XSL
csharphtmlquestionannouncement
3 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.
  • Mike HankeyM Offline
    Mike HankeyM Offline
    Mike Hankey
    wrote on last edited by
    #1

    In the floowinf code I am expecting to append source node to end of destination node but????? //I get the node here based on a source and destination ID. XmlNode sxnode = dom.SelectSingleNode("//KeeperElement[ID = " + srcID + "]"); XmlNode dxnode = dom.SelectSingleNode("//KeeperElement[ID = " + destID + "]"); //This works fine proper nodes are obtained //This append doesn't seem to be working for some reason dxnode.AppendChild(sxnode.CloneNode(true)); //Also the remove not working dom.RemoveChild(sxnode); //When I reload file it shows no changes???? I have experience with ADO.Net do I need to do some sort of Update or AcceptChanges or something similar. Thanks Mike

    Everybody gotta be somebody

    C 1 Reply Last reply
    0
    • Mike HankeyM Mike Hankey

      In the floowinf code I am expecting to append source node to end of destination node but????? //I get the node here based on a source and destination ID. XmlNode sxnode = dom.SelectSingleNode("//KeeperElement[ID = " + srcID + "]"); XmlNode dxnode = dom.SelectSingleNode("//KeeperElement[ID = " + destID + "]"); //This works fine proper nodes are obtained //This append doesn't seem to be working for some reason dxnode.AppendChild(sxnode.CloneNode(true)); //Also the remove not working dom.RemoveChild(sxnode); //When I reload file it shows no changes???? I have experience with ADO.Net do I need to do some sort of Update or AcceptChanges or something similar. Thanks Mike

      Everybody gotta be somebody

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Where did you save the file ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      Mike HankeyM 1 Reply Last reply
      0
      • C Christian Graus

        Where did you save the file ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        Mike HankeyM Offline
        Mike HankeyM Offline
        Mike Hankey
        wrote on last edited by
        #3

        Sorry, I guess that would make a difference wouldn't it?? private void button2_Click(object sender, EventArgs e) { string str = Application.StartupPath + "\\KeeperOut.xml"; XmlTextWriter writer = new XmlTextWriter(str, Encoding.UTF8); dom.WriteContentTo(writer); writer.Flush(); writer.Close(); } Thanks Mike

        You can do anything you want but you pay for everything you do!

        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