This module enhances minidom and will allow you to have ordered attributes instead of having them sorted automaticaly.
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')
Release Notes :
Release 0.1:
First Version
Release 0.2:
Fixed a typo in this doc
Metadata
Release files for enhancedminidom 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| enhancedminidom-0.2.zip | 3.0 kB | Without provenance | Details for enhancedminidom-0.2.zip |
Release files / enhancedminidom-0.2.zip
| Download URL | enhancedminidom-0.2.zip |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a25bc181a71ba7e9814ee5d71a07ed7327faed195376d3f276c1c7f0da156ea1
|
|
BLAKE2b-256 checksum How to use checksums |
df76a194e4942036e9cc3fc06d2386f68aebe874dbda77162b7f984cac7b537f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for enhancedminidom 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.