[
Lists Home |
Date Index |
Thread Index
]
> [Donald Traboini]
>
> > Hi, I am a beginner in XML and Python as well and I am trying to learn as
> > much as possible by writing some examples myself. I created a very simple
> > xml file with just one element. Then I loaded the file into the DOM tree
> > using the 4DOM parser. Once the it was loaded, I appended a couple of
> child
> > elements to the root. This was all fine, but when I went back to the xml
> > file nothing was updated. Isn't the xml file supposed to be updated
> > automatically from the DOM tree? If not, what I do have to do to see the
> > changes?
>
> No, once the processor has processed the file, it is done with the file.
> There would be no further connection with the file unless you wrote some
> code to maintain a connection. That would be very hard (for a general
> case).
>
> If by "see changes" you mean to load an xml file into an editor and look at
> its contents, then you have to serialize the in-memory data (a DOM in this
> case, right?) to a file.
Just so.
I also wanted to add that cDomlette is a much better bet for performance.
http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes
http://www.xml.com/pub/a/2002/10/16/py-xml.html
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Introducing Anobind - http://www.xml.com/pub/a/2003/08/13/py-xml.html
XML Topic Maps by the book - http://www-106.ibm.com/developerworks/xml/library/
x-think19.html
Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h
tml
Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr
ary/ws-pyth13/
Perspective on XML: What is this 'agility'? - http://www.adtmag.com/article.asp
?id=8004
|