Here is actual code:
from lxml import etree
root = etree.Element("doi_batch", attrib={
'xmlns': "http://www.crossref.org/schema/4.4.0",
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
"version": "4.4.0",
"xsi:schemaLocation": "http://www.crossref.org/schema/4.4.0 http://www.crossref.org/schema/deposit/crossref4.4.0.xsd"
})
print(etree.tostring(root, encoding="UTF-8",
method="xml", xml_declaration=True, pretty_print=True))
The problem is that some attributes require to have colon in their names, so I'm getting error in output. Is there any solution for this type of errors?
OUTPUT: