[英]Changing document's attributes in Python's xml.dom.minidom
I created a xml.dom.minidom.Document
. 我创建了一个xml.dom.minidom.Document
。
How do I give it attributes so that when I do .toprettyxml()
it will show like this: 我该如何赋予它属性,以便当我执行.toprettyxml()
,它将显示如下:
<?xml version="1.0" encoding="iso-8859-2"?>
.toprettyxml()
具有编码关键字参数:
Document.toprettyxml(self, indent='\t', newl='\n', encoding=None)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.