I have a huge xml file (1 Gig). I want to move some of the elements (entrys) to another file with the same header and specifications.
Let\'s say the original file co
There is a way to remove namespaces with XSLT:
import io
import lxml.etree as ET
def remove_namespaces(doc):
# http://wiki.tei-c.org/index.php/Remove-Namespaces.xsl
xslt='''
'''
xslt_doc = ET.parse(io.BytesIO(xslt))
transform = ET.XSLT(xslt_doc)
doc = transform(doc)
return doc
doc = ET.parse('data.xml')
doc = remove_namespaces(doc)
print(ET.tostring(doc))
yields
some text