簡體   English   中英

在Python的xml.dom.minidom中更改文檔的屬性

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM