OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Python/XML parsing

[ 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.


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/
Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h
Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr
Perspective on XML: What is this 'agility'? - http://www.adtmag.com/article.asp


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS