Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating the database by xml

Status
Not open for further replies.

JohnMethew

Programmer
Apr 4, 2006
8
US

I have a database like,
Code:
<database>
  <entry>
    <data> data 1 </data>
    <data> data 2 </data>
  </entry>
  <entry>
   ----
   ----
   </entry>
</database>

I want to add new entry in my database, and that new entry i have in DOM format, how do I add that new entry in existing database of xml format.

entry to add
Code:
<entry>
 <data> data 4 </data>
 <data>
</entry>
 
Would it not depend on what platform/utility you are using?
 

Sorry to reply late, actually I have done this now.. and sorry for not mentioning the Technology.

what I found was keep your database(xml file) ~wellformed. then if you want to populate the databse, simply append the data(entry to be added) to the database file by File IO operation. this is more of mechenical solution .. but it works well.

Or we can create a DOM of database and append the data as new node to existing database and again write it on file ..

But DOM is always well formed, how will it maintain our incomplete database(~wellformed). I still have to figureit out how to do this one ..

Regards.
 
I'm shuddering at the use of the word "database" for an XML file...

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
OK, you got me on that one!
;-)

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
>I sometimes shudder when XML files are discussed, because the XML recommendation uses the term document.
That for the sake of discussion, I can offer a reason. It is because load and save is off-standard, meaning the matter related to the file itself is not governed by the standard/recommendation (yet).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top