Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML question
#1
Hi,

I'm just being curious Cool
When i program with an xml database, i can e.g. add a new "record",
and even add a new field to existing records in the database etc.(using elementTree)

It strikes me that during those operations you never say something like
"save" or "additem", or...
Only a the very end one does a tree.write(...),
and that (probably) overwrites the existing xml file.

My question: you start by reading the existing xml (db = ET.parse('members.xml')
and this keeps the whole thing in memory until the moment that you do tree.write?
I can imagine issues when the computer crashes.
So, is it best proctice to do multiple tree.write()s during operations?

thx,
Paul
Reply


Messages In This Thread
XML question - by DPaul - Mar-18-2020, 07:46 AM
RE: XML question - by buran - Mar-18-2020, 07:51 AM
RE: XML question - by DPaul - Mar-18-2020, 08:37 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020