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 / C++ / MFC
  4. Reading Writing XML in C++ 6.0

Reading Writing XML in C++ 6.0

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++htmlxml
4 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.
  • G Offline
    G Offline
    Gilfrog
    wrote on last edited by
    #1

    What is the best way to use XML in C++ 6.0? DOM or SAX, wich is the easiest and efficient way to read and write data. examples and comments welcome thanks

    J P 2 Replies Last reply
    0
    • G Gilfrog

      What is the best way to use XML in C++ 6.0? DOM or SAX, wich is the easiest and efficient way to read and write data. examples and comments welcome thanks

      J Offline
      J Offline
      Jason Henderson
      wrote on last edited by
      #2

      The DOM works well for small files, SAX for larger ones.

      Jason Henderson
      start page
      articles
      "If you are going through hell, keep going." - Sir Winston Churchill

      1 Reply Last reply
      0
      • G Gilfrog

        What is the best way to use XML in C++ 6.0? DOM or SAX, wich is the easiest and efficient way to read and write data. examples and comments welcome thanks

        P Offline
        P Offline
        Paul M Watt
        wrote on last edited by
        #3

        One more thing to consider with the DOM versus SAX, The DOM creates persistant data for your XML. It will read the data in and create an internal structure that you can refer back to whenever you need to read from a certain node. The SAX on the other hand is a one pass mechanism, where you will use the APIs to read and write the data. The data is not persistant in the SAX API so once it has been read, it is forgotten and you are responsible for persiting the data in your app.


        Build a man a fire, and he will be warm for a day
        Light a man on fire, and he will be warm for the rest of his life!

        S 1 Reply Last reply
        0
        • P Paul M Watt

          One more thing to consider with the DOM versus SAX, The DOM creates persistant data for your XML. It will read the data in and create an internal structure that you can refer back to whenever you need to read from a certain node. The SAX on the other hand is a one pass mechanism, where you will use the APIs to read and write the data. The data is not persistant in the SAX API so once it has been read, it is forgotten and you are responsible for persiting the data in your app.


          Build a man a fire, and he will be warm for a day
          Light a man on fire, and he will be warm for the rest of his life!

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          The downside with SAX is that you almost inevitably end up writing FSA style stuff to deal with the incoming data, and there's no support for navigating the document as in DOM. While writing a state machine isn't exactly rocket science, if you have never done it before there are many things to watch out for. Steve S [This signature space available for rent]

          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