我遵循此线程的帮助。 How do I get Python's ElementTree to pretty print to an XML file?
但是我有一个我不明白的错误。
css: [
'@/assets/main.scss',
]
File "myprogram.py", line 505, in get_phyloxml_extended
xmlstr = minidom.parseString(ET.tostring(root).decode("utf-8")).toprettyxml(indent=" ")
File "/usr/lib/python3.6/xml/dom/minidom.py", line 1968, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python3.6/xml/dom/expatbuilder.py", line 925, in parseString
return builder.parseString(string)
File "/usr/lib/python3.6/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 425
答案 0 :(得分:0)
标签之一是数字,所以它不起作用.....
像<phy:00000001>2.0<phy:00000001>
一样不起作用
但是...
但是...
<phy:a00000001>2.0<phy:a00000001>
的工作-'