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

Discussion in 'Python' started by aine_canby@yahoo.com, Aug 3, 2007.

  1. Guest

    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.
     
    , Aug 3, 2007
    #1
    1. Advertising

  2. 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=
    [mailto:python-list-bounces+robert.rawlins=]
    On Behalf Of
    Sent: 03 August 2007 14:39
    To:
    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.

    --
    http://mail.python.org/mailman/listinfo/python-list
     
    Robert Rawlins - Think Blue, Aug 3, 2007
    #2
    1. Advertising

  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
     
    Stefan Behnel, Aug 3, 2007
    #3
  4. 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
     
    Stefan Behnel, Aug 3, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roman Yakovenko

    xml.dom.minidom - bug ? future ?

    Roman Yakovenko, Sep 4, 2003, in forum: Python
    Replies:
    1
    Views:
    350
    =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=
    Sep 4, 2003
  2. Hans Nowak
    Replies:
    1
    Views:
    402
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 4, 2003
  3. Greg Wogan-Browne
    Replies:
    1
    Views:
    857
    Uche Ogbuji
    Jan 28, 2005
  4. Johannes Bauer
    Replies:
    7
    Views:
    1,083
    Johannes Bauer
    Jun 11, 2009
  5. ming
    Replies:
    2
    Views:
    209
Loading...

Share This Page