Last active
May 4, 2019 14:16
-
-
Save mvoong/aeca83a660cbc8dee04c678a2f795af8 to your computer and use it in GitHub Desktop.
Android namespace declaration in lxml
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
import lxml.etree as etree | |
tools_ns = "http://schemas.android.com/tools" | |
root = etree.Element("resources", nsmap={"tools": tools_ns}) | |
root.attrib['{%s}ignore' % tools_ns] = 'MissingTranslation' | |
print(etree.tostring(root, encoding="unicode", pretty_print=True)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment