Replacing _xmlplus.dom.minidom with xml.dom.minidom

A

aine_canby

Hi,

I'm working with a number of scripts which were written years ago for
my company for Python 2.2, and I'd like to update for Python 2.5. I
have written a script to add # -*- coding: cp1252 -*- to the beginning
of all my scripts, and that has fixed the encoding issues.

Another issue was the use of -

from _xmlplus.dom import minidom

http://sourceforge.net/project/showfiles.php?group_id=6473

I couldn't get a version of this module for 2.5, so I changed the
above to -

from xml.dom import minidom

The scripts I work with are all working now correctly for 2.5. But I
haven't been able to test the whole system as not all of it concerns
me. Anyway, my colleges are interested in updating also if it will be
reasonably hassle free.

So my main concern now is the use of _xmlplus.dom.minidom. Why was it
used and what differences should I look out for with regard to
xml.dom.mididom

Thanks very much for your help,

Barry.
 
R

Robert Rawlins - Think Blue

Just as a heads up, minidom is pretty inefficient and difficult to work with
too.

On someone else's advice I switched over to ElementTree and have been really
pleased with the results, its much simpler to work with and more efficient
too.

Rob

-----Original Message-----
From: python-list-bounces+robert.rawlins=thinkbluemedia.co.uk@python.org
[mailto:python-list-bounces+robert.rawlins=thinkbluemedia.co.uk@python.org]
On Behalf Of (e-mail address removed)
Sent: 03 August 2007 14:39
To: (e-mail address removed)
Subject: Replacing _xmlplus.dom.minidom with xml.dom.minidom

Hi,

I'm working with a number of scripts which were written years ago for
my company for Python 2.2, and I'd like to update for Python 2.5. I
have written a script to add # -*- coding: cp1252 -*- to the beginning
of all my scripts, and that has fixed the encoding issues.

Another issue was the use of -

from _xmlplus.dom import minidom

http://sourceforge.net/project/showfiles.php?group_id=6473

I couldn't get a version of this module for 2.5, so I changed the
above to -

from xml.dom import minidom

The scripts I work with are all working now correctly for 2.5. But I
haven't been able to test the whole system as not all of it concerns
me. Anyway, my colleges are interested in updating also if it will be
reasonably hassle free.

So my main concern now is the use of _xmlplus.dom.minidom. Why was it
used and what differences should I look out for with regard to
xml.dom.mididom

Thanks very much for your help,

Barry.
 
S

Stefan Behnel

Robert said:
Just as a heads up, minidom is pretty inefficient and difficult to work with
too.

On someone else's advice I switched over to ElementTree and have been really
pleased with the results, its much simpler to work with and more efficient
too.

/and/ lxml.etree is compatible to ElementTree, so once you have written your
code for ElementTree, you can switch to lxml.etree if ever you need things
like XPath, XSLT or validation.

However, as I understand the OP, the question deals with old code, so porting
it to ET (i.e. reimplementing it) might not be that easy...

Stefan
 
S

Stefan Behnel

Robert said:
Just as a heads up, minidom is pretty inefficient and difficult to work with
too.

On someone else's advice I switched over to ElementTree and have been really
pleased with the results, its much simpler to work with and more efficient
too.

/and/ lxml.etree is compatible to ElementTree, so once you have written your
code for ElementTree, you can switch to lxml.etree if ever you need things
like XPath, XSLT or validation.

However, as I understand the OP, the question deals with old code, so porting
it to ET (i.e. reimplementing it) might not be that easy...

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top