473,699 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing _xmlplus.dom.mi nidom 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/showf...?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.mi nidom. 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.

Aug 3 '07 #1
3 2004
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: py************* *************** *************** **********@pyth on.org
[mailto:py****** *************** *************** *************** **@python.org]
On Behalf Of ai********@yaho o.com
Sent: 03 August 2007 14:39
To: py*********@pyt hon.org
Subject: Replacing _xmlplus.dom.mi nidom 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/showf...?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.mi nidom. 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.

--
http://mail.python.org/mailman/listinfo/python-list

Aug 3 '07 #2
Robert Rawlins - Think Blue wrote:
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
Aug 3 '07 #3
Robert Rawlins - Think Blue wrote:
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
Aug 3 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2173
by: Sunil Movva | last post by:
I have an application that uses xml to communicate between threads. One of the threads in my app creates an xml message and sends it to a second thread. This second thread parses the message and creates a new xml message copying most part of the first message and sends it to a third thread. The second thread was able to parse the message, while the third thread is not able to parse the message that it received. I am using minidom...
5
4823
by: Skip Montanaro | last post by:
I'd like to compare two xml.dom.minidom objects, but the naive attempt fails: >>> import xml.dom.minidom >>> d1 = xml.dom.minidom.parse("ES.xml") >>> d2 = xml.dom.minidom.parse("ES.xml") >>> d1 == d2 False My goal is to decide whether or not I need to prompt the user to save config information at the end of a program run by generating a minidom object then
5
6386
by: Mike McGavin | last post by:
Hi everyone. I've been trying for several hours now to get minidom to parse namespaces properly from my stream of XML, so that I can use DOM methods such as getElementsByTagNameNS(). For some reason, though, it just doesn't seem to want to split the prefixes from the rest of the tags when parsing. The minidom documentation at http://docs.python.org/lib/module-xml.dom.minidom.html implies that
6
3982
by: Horst Gutmann | last post by:
Hi :-) I currently have quite a big problem with minidom and special chars (for example &uuml;) in HTML. Let's say I have following input file: -------------------------------------------------- <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html>
4
6065
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
6
5791
by: saif.shakeel | last post by:
Hi, I need to replace a string in xml file with something else.Ex - <SERVICEPARAMETER id="_775" Semantics="subfunction" DDORef="_54"> <SHORTNAME>rate</SHORTNAME> <LONGNAME>rate</LONGNAME> <VALUE role="constant" DataType="unsigned" value="1" /> <BYTEPOSITION role="position" BytePos="1" /> </SERVICEPARAMETER> - <SERVICEPARAMETER id="_776" Semantics="localId" DDORef="_54">
18
758
by: sim.sim | last post by:
Hi all. i'm faced to trouble using minidom: #i have a string (xml) within CDATA section, and the section includes "\r\n": iInStr = '<?xml version="1.0"?>\n<Data><!]></Data>\n' #After i create DOM-object, i get the value of "Data" without "\r\n"
0
1513
by: Gary | last post by:
Howdy I ran into a difference between Python on Windows XP and Linux Fedora 6. Writing a dom to xml with minidom works on Linux. It gives an error on XP if there is an empty namespace. The problem was handled in CVS a while ago. http://mail.python.org/pipermail/xml-sig/2003-October/009904.html
2
12585
by: ashmir.d | last post by:
Hi, I am trying to parse an xml file using the minidom parser. <code> from xml.dom import minidom xmlfilename = "sample.xml" xmldoc = minidom.parse(xmlfilename) </code> The parser is failing on this line:
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.