python - Rearrange the attributes in a node lxml -
this question has answer here:
i have element node
<relationship type="http://schemas.openxmlformats.org/officedocument/2006/relationships/fonttable" id="rid61" target="media/image1.png"/>
i need attributes sorted in order. output should like
<relationship id="rid61" type="http://schemas.openxmlformats.org/officedocument/2006/relationships/fonttable" target="media/image1.png"/>
how rearrange this? using lxml library
thanks
there no way set specific order of element attributes using lxml
. element.attrib
dictionary, dictionaries in python unordered collections.
also see:
Comments
Post a Comment