Solved

XML database in disk file

Posted on 2004-03-22
3
226 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now