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. XML / XSL
  4. Modify large XML files [modified]

Modify large XML files [modified]

Scheduled Pinned Locked Moved XML / XSL
questionxmldatabaseperformancetutorial
2 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.
  • R Offline
    R Offline
    rzumbado
    wrote on last edited by
    #1

    Hi everyone :-D , I have a really big question about editing large XML files. Im building a little XML Database engine (like a mini database engine using xml as a storage). I can create tables and select data from them. My question is: since the XmlDocument class loads the entire xml data into memory and data files could take longer than 100 MB, Which is the best way to modify data on large XML files? For example: If i have the next XML file:

    <invoices>
    <invoice id="1">
    <amount>100,000.00</amount>
    <currency>Dolar</currency>
    <refnum1>9486692001</refnum1>
    <refnum2>NULL</refnum2>
    <createdate>2008-05-19 4:21:34.532 PM</createdate>
    </invoice>
    ...
    </invoices>

    And that file has like 500.000 rows on it, how can i modify the value of the single node 'RefNum2' where the invoice id is '1' without using the XmlDocument class? I know i can use the XPathNavigator using the xpath string 'Invoices/Invoice[@id="1"]' but how can i set the value and save the file? This is driving me nuts :( ! haha

    modified on Monday, May 19, 2008 6:59 PM

    C 1 Reply Last reply
    0
    • R rzumbado

      Hi everyone :-D , I have a really big question about editing large XML files. Im building a little XML Database engine (like a mini database engine using xml as a storage). I can create tables and select data from them. My question is: since the XmlDocument class loads the entire xml data into memory and data files could take longer than 100 MB, Which is the best way to modify data on large XML files? For example: If i have the next XML file:

      <invoices>
      <invoice id="1">
      <amount>100,000.00</amount>
      <currency>Dolar</currency>
      <refnum1>9486692001</refnum1>
      <refnum2>NULL</refnum2>
      <createdate>2008-05-19 4:21:34.532 PM</createdate>
      </invoice>
      ...
      </invoices>

      And that file has like 500.000 rows on it, how can i modify the value of the single node 'RefNum2' where the invoice id is '1' without using the XmlDocument class? I know i can use the XPathNavigator using the xpath string 'Invoices/Invoice[@id="1"]' but how can i set the value and save the file? This is driving me nuts :( ! haha

      modified on Monday, May 19, 2008 6:59 PM

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

      The core issue is probably that you'd be better off using a database. Is there a SAX implimentation in .NET ? I'd think that's whaty ou need.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      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