Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    enhancedminidom 0.2

    Download button

    No screenshots available
    Downloads: 99  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Yves-Gwenael Bourhis | More programs
    GPL / FREE
    February 18th, 2012, 03:55 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    enhancedminidom description

    Enhance minidom in order to have ordered (instead of sorted) attributes, and a 'getElementsByAttributeName' method

    enhancedminidom is a Python module that enhances minidom and will allow you to have ordered attributes instead of having them sorted automatically.

    It is relevent in the fact that you may want to script the loading/modification/saving of xml files and then print out a diff. with the normal minidom since attributes are sorted automaticaly you can have an unwanted diff for each unchaged line just because the order of the attributes changed.

    once you load this module, just use minidom normaly.

    example:

    >>> from xml.dom import minidom
    >>> import enhancedminidom


    then use minidom normaly except that:

    - Document and Element classes have a 'getElementsByAttributeName' method which can be verry handy.
    - 'toxml' and 'toprettyxml' will print attributes in the order they are created/loaded if 'minidom.SORTEDATTRIBUTES = False' (default)

    example to get all nodes having a "foo" attribute:

    >>> document = minidom.parse('yourfile.xml')
    >>> nodes_with_foo = document.getElementsByAttributeName('foo')


    example to get all nodes having a "foo" attribute if they are in a "fum" tag:

    >>> document = minidom.parse('yourfile.xml')
    >>> nodes_with_foo = document.getElementsByAttributeName('foo', 'fum')



    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Fixed a typo in this doc.

      


    TAGS:

    enhance minidom | Python library | Python | enhance | minidom

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM