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. The Lounge
  3. code [npq]

code [npq]

Scheduled Pinned Locked Moved The Lounge
questioncomlinuxxml
7 Posts 4 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.
  • S Offline
    S Offline
    Steven Hicks n 1
    wrote on last edited by
    #1

    I just rewrote lots of my code in my application last night (simpilfied ~25 lines into 3 (with use of a function (also 3 lines)) and now the features run faster and don't crash. Arrughh! I can't believe that it could have been simpified to that.. (it was dealling with XML processing) Has this happened to anyone else? -Steven npq=not (a) programming question

    By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.

    For those who were wondering, actual (Linux) Penguins were harmed in creating this message.

    Visit Ltpb.8m.com
    404Browser (Efficient, Fast, Secure Web Browser): 404Browser.com

    C J 2 Replies Last reply
    0
    • S Steven Hicks n 1

      I just rewrote lots of my code in my application last night (simpilfied ~25 lines into 3 (with use of a function (also 3 lines)) and now the features run faster and don't crash. Arrughh! I can't believe that it could have been simpified to that.. (it was dealling with XML processing) Has this happened to anyone else? -Steven npq=not (a) programming question

      By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.

      For those who were wondering, actual (Linux) Penguins were harmed in creating this message.

      Visit Ltpb.8m.com
      404Browser (Efficient, Fast, Secure Web Browser): 404Browser.com

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

      Yup - exact same thing. Wrote 30 odd lines of code to format XML nicely, then found a method that did it for me, better and faster. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      L 1 Reply Last reply
      0
      • S Steven Hicks n 1

        I just rewrote lots of my code in my application last night (simpilfied ~25 lines into 3 (with use of a function (also 3 lines)) and now the features run faster and don't crash. Arrughh! I can't believe that it could have been simpified to that.. (it was dealling with XML processing) Has this happened to anyone else? -Steven npq=not (a) programming question

        By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.

        For those who were wondering, actual (Linux) Penguins were harmed in creating this message.

        Visit Ltpb.8m.com
        404Browser (Efficient, Fast, Secure Web Browser): 404Browser.com

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        Yes, it has happened to me. And it's a great feeling because you know you've gained experience. -- If I had the ability to smooth talk like John Simmons, this post would be less sarcastic and more to the point.

        1 Reply Last reply
        0
        • C Christian Graus

          Yup - exact same thing. Wrote 30 odd lines of code to format XML nicely, then found a method that did it for me, better and faster. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

          L Offline
          L Offline
          Loren Brewer
          wrote on last edited by
          #4

          Christian Graus wrote: then found a method that did it for me, better and faster Was it something you found on CP? Or someplace else? Do tell! Do tell! :-D

          C 1 Reply Last reply
          0
          • L Loren Brewer

            Christian Graus wrote: then found a method that did it for me, better and faster Was it something you found on CP? Or someplace else? Do tell! Do tell! :-D

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

            No, just something that the .NET framework provided by itself. I forget the details, did you want me to find them out for you ? The code is at home.... Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

            L 1 Reply Last reply
            0
            • C Christian Graus

              No, just something that the .NET framework provided by itself. I forget the details, did you want me to find them out for you ? The code is at home.... Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

              L Offline
              L Offline
              Loren Brewer
              wrote on last edited by
              #6

              Christian Graus wrote: did you want me to find them out for you ? Sure! When you get a chance... :D

              C 1 Reply Last reply
              0
              • L Loren Brewer

                Christian Graus wrote: did you want me to find them out for you ? Sure! When you get a chance... :D

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

                It looks like this:

                		StringBuilder sbDocString = new StringBuilder();
                		StringWriter swControlWriter = new StringWriter(sbDocString);
                		XmlTextWriter oDocWriter = new XmlTextWriter(swControlWriter);
                
                		oDocWriter.Formatting = Formatting.Indented;
                		XmlDocument doc = new XmlDocument();
                		doc.LoadXml(sXML);
                		doc.Save(oDocWriter);
                		return sbDocString.ToString();
                

                sXML is a string of XML passed into the function. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

                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