473,748 Members | 6,418 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 2010
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
2175
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
4827
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
6389
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
3987
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
6071
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
5794
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
1517
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
12595
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
8987
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
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
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
8239
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...
0
6073
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();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.