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. Memory, speed and MSXML

Memory, speed and MSXML

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelpcryptographyxmlquestion
4 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.
  • A Offline
    A Offline
    Argonia
    wrote on last edited by
    #1

    Hello, i have a question about the MSXML library. I fail to find how exactly they read the XML Document when its already loaded into memory. If i look for XML nodes do they read the whole document from top to bottom until find it or its something with hash tables. My problem is that i have to remove some elements for existent XML document and add it in another. I was wondering which is better(according to speed) to keep the XML Nodes in std::vectors and remove the needed items and put them in the new XML Document and this only with 2 read/write operations on the XML Document or i should get the first part of the items do whatever i have to do with them and then take the next part and so on. This will cause for at least 8 times reading the existent XML Document and getting XML NodeLists out of it. The problem here is that the first XML Document can be really big. I think its better to read the information only once and do what i have to do with it and then write it in the new XML Document. At least i think its gonna be faster but i am not sure exactly how MSXML does the operations on the XML Document. Thank you for your help. :)

    D 1 Reply Last reply
    0
    • A Argonia

      Hello, i have a question about the MSXML library. I fail to find how exactly they read the XML Document when its already loaded into memory. If i look for XML nodes do they read the whole document from top to bottom until find it or its something with hash tables. My problem is that i have to remove some elements for existent XML document and add it in another. I was wondering which is better(according to speed) to keep the XML Nodes in std::vectors and remove the needed items and put them in the new XML Document and this only with 2 read/write operations on the XML Document or i should get the first part of the items do whatever i have to do with them and then take the next part and so on. This will cause for at least 8 times reading the existent XML Document and getting XML NodeLists out of it. The problem here is that the first XML Document can be really big. I think its better to read the information only once and do what i have to do with it and then write it in the new XML Document. At least i think its gonna be faster but i am not sure exactly how MSXML does the operations on the XML Document. Thank you for your help. :)

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Argonia wrote:

      I fail to find how exactly they read the XML Document when its already loaded into memory.

      Did you look at the selectSingleNode() method?

      Argonia wrote:

      My problem is that i have to remove some elements for existent XML document and add it in another.

      So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.

      Argonia wrote:

      ...but i am not sure exactly how MSXML does the operations on the XML Document.

      While there are certainly better and more exhaustive examples available, I show how to briefly use MSXML here.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      A 1 Reply Last reply
      0
      • D David Crow

        Argonia wrote:

        I fail to find how exactly they read the XML Document when its already loaded into memory.

        Did you look at the selectSingleNode() method?

        Argonia wrote:

        My problem is that i have to remove some elements for existent XML document and add it in another.

        So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.

        Argonia wrote:

        ...but i am not sure exactly how MSXML does the operations on the XML Document.

        While there are certainly better and more exhaustive examples available, I show how to briefly use MSXML here.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        A Offline
        A Offline
        Argonia
        wrote on last edited by
        #3

        DavidCrow wrote:

        Did you look at the selectSingleNode() method?

        My question is what is in this function.

        DavidCrow wrote:

        So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.

        I can't change the given XML Document. I have to get some of the nodes of the first and add them to the second Document .

        D 1 Reply Last reply
        0
        • A Argonia

          DavidCrow wrote:

          Did you look at the selectSingleNode() method?

          My question is what is in this function.

          DavidCrow wrote:

          So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.

          I can't change the given XML Document. I have to get some of the nodes of the first and add them to the second Document .

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Argonia wrote:

          My question is what is in this function.

          Unless I had access to the source code, I wouldn't have a clue (nor would I care). If I were to surmise a guess, the class has some private member variable (e.g., file pointer or handle) that keeps track of when a file has been read or not.

          Argonia wrote:

          I can't change the given XML Document. I have to get some of the nodes of the first and add them to the second Document .

          You can either remove unwanted nodes from the first and write the balance to the second, or copy wanted nodes from the first to the second. The net result would be the same.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          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