Re: Modules for Python writng to XML

Date : Thu, 26 Oct 2006 13:05:00 -0400
To : XSI(at)Softimage.COM
From : François Painchaud <francois.painchaud(at)sympatico.ca>
Subject : Re: Modules for Python writng to XML
Hi Andre,

Module xml.dom.minidom does a fine job.
For example, to parse and save back an XML file:

    import xml.dom.minidom
   
    oSceneTOCDoc = xml.dom.minidom.parse( sSceneTOCPath )
   
    # Do your XML stuff with oSceneTOCDoc here.
   
    oSceneTOCFile = open( sSceneTOCPath, "w" )
    oSceneTOCDoc.writexml( oSceneTOCFile )
    oSceneTOCFile.close()

For references, see:
    http://docs.python.org/lib/module-xml.dom.minidom.html
    http://www.oreilly.com/catalog/pythonxml/index.html
    http://softimage.wiki.avid.com/index.php/XML_%28XSISDK%29

François

-------- Message original --------
Sujet: Modules for Python writng to XML
Date: Thu, 26 Oct 2006 11:53:07 -0400
De: Andre DeAngelis <andre.deangelis(at)ubisoft.com>
Pour: <XSI(at)Softimage.COM>

Hello Python Gurus out there

I am porting an old script from jscript to python for exporting cluster
data to XML.

There seems to be more than one XML module for Python, so I was
wondering if here were any recommendations which to use.  

If anyone could share an example of it in use, that of course would be
very much appreciated.

Andre 

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.