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. C#
  4. removing XML entries

removing XML entries

Scheduled Pinned Locked Moved C#
xmlquestion
8 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.
  • M Offline
    M Offline
    Mridang Agarwalla
    wrote on last edited by
    #1

    i have a XML file and i wish to remove a few nodes from it...I am using the XMLDocument class...How can i do this without loading it into a dataset or something..

    B 1 Reply Last reply
    0
    • M Mridang Agarwalla

      i have a XML file and i wish to remove a few nodes from it...I am using the XMLDocument class...How can i do this without loading it into a dataset or something..

      B Offline
      B Offline
      BammBamm
      wrote on last edited by
      #2

      What exaclty are you trying to do. Permanently remove nodes from the document? Copy nodes to nodes outside the document?

      M 1 Reply Last reply
      0
      • B BammBamm

        What exaclty are you trying to do. Permanently remove nodes from the document? Copy nodes to nodes outside the document?

        M Offline
        M Offline
        Mridang Agarwalla
        wrote on last edited by
        #3

        like..if i document that was like.. A A A A A A

        A

        A A A A now suppose i want to remove the field called zipcode.. how do i do that?

        M 1 Reply Last reply
        0
        • M Mridang Agarwalla

          like..if i document that was like.. A A A A A A

          A

          A A A A now suppose i want to remove the field called zipcode.. how do i do that?

          M Offline
          M Offline
          Mridang Agarwalla
          wrote on last edited by
          #4

          A A A A A A A A A A A

          M 1 Reply Last reply
          0
          • M Mridang Agarwalla

            A A A A A A A A A A A

            M Offline
            M Offline
            Mridang Agarwalla
            wrote on last edited by
            #5

            i dunno why im unable to put xml text here

            D 1 Reply Last reply
            0
            • M Mridang Agarwalla

              i dunno why im unable to put xml text here

              D Offline
              D Offline
              DavidNohejl
              wrote on last edited by
              #6

              Just check "Do not treat <'s as HTML tags". Never forget: "Stay kul and happy" (I.A.)
              David's thoughts / dnhsoftware.org / MyHTMLTidy

              M 1 Reply Last reply
              0
              • D DavidNohejl

                Just check "Do not treat <'s as HTML tags". Never forget: "Stay kul and happy" (I.A.)
                David's thoughts / dnhsoftware.org / MyHTMLTidy

                M Offline
                M Offline
                Mridang Agarwalla
                wrote on last edited by
                #7

                A A A A A A

                A

                A A A A I want to remove the node called zipcode

                B 1 Reply Last reply
                0
                • M Mridang Agarwalla

                  A A A A A A

                  A

                  A A A A I want to remove the node called zipcode

                  B Offline
                  B Offline
                  BammBamm
                  wrote on last edited by
                  #8

                  Try this System.Xml.XmlNode node; System.Xml.XmlDocument doc = new XmlDocument(); doc.LoadXml("jon3547408"); this.textBox1.Text=doc.InnerXml; node = doc.SelectSingleNode("person"); node.RemoveChild( doc.SelectSingleNode("person//zip")); textBox1.Text += "\n" + doc.InnerXml;

                  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