![](/img/trans.png)
[英]getElementsByTagName() in Python's xml.dom.minidom is not working
[英]Changing document's attributes in Python's xml.dom.minidom
我創建了一個xml.dom.minidom.Document
。
我該如何賦予它屬性,以便當我執行.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.