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. working with large xml files

working with large xml files

Scheduled Pinned Locked Moved C#
databasexmlquestionhelp
6 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.
  • C Offline
    C Offline
    cellardoor0716
    wrote on last edited by
    #1

    I´m working with large xml files(about 100MB) and what I have to do is: - first validate the xml file against a schema - then insert data from the file to a database What is the most efficient way to do this? Can anyone help me with this?

    cellardoor

    E E S 3 Replies Last reply
    0
    • C cellardoor0716

      I´m working with large xml files(about 100MB) and what I have to do is: - first validate the xml file against a schema - then insert data from the file to a database What is the most efficient way to do this? Can anyone help me with this?

      cellardoor

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      Efficient at 100 megs may not be that big of an issue. System.Xml.XmlReader is the fast method for reading. System.Xml.XmlValidatingReader will validate.


      File Not Found

      E 1 Reply Last reply
      0
      • C cellardoor0716

        I´m working with large xml files(about 100MB) and what I have to do is: - first validate the xml file against a schema - then insert data from the file to a database What is the most efficient way to do this? Can anyone help me with this?

        cellardoor

        E Offline
        E Offline
        eggie5
        wrote on last edited by
        #3

        Yeah, Ennis Ray Lynch, Jr. is right, you want to use a sax based reader like XmlReader because a DOM based reader like XmlDocument would be too slow.

        /\ |_ E X E GG

        C 1 Reply Last reply
        0
        • E eggie5

          Yeah, Ennis Ray Lynch, Jr. is right, you want to use a sax based reader like XmlReader because a DOM based reader like XmlDocument would be too slow.

          /\ |_ E X E GG

          C Offline
          C Offline
          cellardoor0716
          wrote on last edited by
          #4

          Thanks I´ll try it

          cellardoor

          1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            Efficient at 100 megs may not be that big of an issue. System.Xml.XmlReader is the fast method for reading. System.Xml.XmlValidatingReader will validate.


            File Not Found

            E Offline
            E Offline
            eggie5
            wrote on last edited by
            #5

            Using a DOM reader like XmlDocument is the standard way to read/edit xml documents (at least I think...) because you can use XPATH and stuff. However, if you read a 100MB xml document with a dom reader your program will be suddenly using 100MB of ram. I'm pretty sure you don't want that...

            /\ |_ E X E GG

            1 Reply Last reply
            0
            • C cellardoor0716

              I´m working with large xml files(about 100MB) and what I have to do is: - first validate the xml file against a schema - then insert data from the file to a database What is the most efficient way to do this? Can anyone help me with this?

              cellardoor

              S Offline
              S Offline
              Stefan Troschuetz
              wrote on last edited by
              #6

              The following link should be helpful for the validation part: Validating XML Data with XmlReader[^]


              "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

              www.troschuetz.de

              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