Solved

XML database in disk file

Posted on 2004-03-22
3
262 Views
Last Modified: 2010-05-18
Hi
i proposed to the client that we should not use the database like Access for out project. As in our application we have only one table i proposed to use a XML file.

Application will be developed in VB6.

Now what i want is that i want to use the DOM.  Problem is DOM reads the whole file in memory.  I do not want to read the whole XML file in memory instead i give a XPATH Query and DOM loads only selected nodes from disk to memory. Then i want to do operation like add a new record, modify and delete record and still i do not want to load the entire XML file in memory.

Here is what should be the XML database file format

<Database>
<Table Name = " ">
     <Record ID="1">
             <field1 value="">
             <field2 value="">
             <field3 value="">
      </Record>

     <Record ID="2">
             <field1 value="">
             <field2 value="">
             <field3 value="">
      </Record>

     <Record ID="3">                    i want only one record
             <field1 value="">            to be load in DOM
             <field2 value="">
             <field3 value="">            also i want to modify
      </Record>                             this record in the file

                                                  I ALso want to delete
                                                  this record from XML
                                                                                    ----------and so on-------------
</Table>

-----More tables in future here----------------
</Database>

I think file will grow 200K each month by added new records. So loading the entire file in memory will not be acceptable solution after say 1 year.

I will also conside if there is a samll XML database available on the internet. PLease suggest free tool

Thanks
Shahzad
0
Comment
Question by:shahzad73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 125 total points
ID: 10653990
I don't think you can use XPATH to pull just specific nodes without loading the XML into memory.

I could easily be wrong, but every example I can find starts with a Load command.  Eg:

   http://msdn.microsoft.com/library/en-us/xmlsdk/htm/dom_hdi_vb_2w8j.asp

One possibility would be to write a pre-processor that scanned through the file to locate specific items, then generate a new subset XML file and load it.

-- Dan
0
 
LVL 1

Author Comment

by:shahzad73
ID: 10656213
thanks for the advise...

lets see some body comes up with some other idea.


Shahzad
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question