Created
October 2, 2015 19:57
-
-
Save walkerdb/a31ef831e73f2ffab91c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # make a new, empty tag | |
| >>> new_tag = etree.Element("extent") | |
| # add some text | |
| >>> new_tag.text = "25 embarrassing photos" | |
| # add an attribute if you want any | |
| >>> new_tag.attrib["encodinganalog"] = "300" | |
| # insert the new tag into the master ead tree | |
| # we'll use the parent element from last time | |
| >>> parent.append(new_tag) | |
| >>> print(etree.tostring(parent)) | |
| ''' | |
| <physdesc altrender="whole"> | |
| <extent encodinganalog="300">25 embarrassing photos</extent> | |
| </physdesc> | |
| ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment