From 8ab3e5a67211e9cb41bf269329bc49ee479bcce9 Mon Sep 17 00:00:00 2001 From: Roman Rolinsky Date: Thu, 17 Oct 2002 18:33:41 +0000 Subject: [PATCH] Customised XML writing - include encoding header attribute git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/tools/XRCed/myxml.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 wxPython/wxPython/tools/XRCed/myxml.py diff --git a/wxPython/wxPython/tools/XRCed/myxml.py b/wxPython/wxPython/tools/XRCed/myxml.py new file mode 100644 index 0000000000..de53dfca3f --- /dev/null +++ b/wxPython/wxPython/tools/XRCed/myxml.py @@ -0,0 +1,19 @@ +# Name: myxml.py +# Purpose: XRC editor, XML stuff +# Author: Roman Rolinsky +# Created: 15.10.2002 +# RCS-ID: $Id$ + +from xml.dom import minidom + +# Redefine writing to include encoding +class MyDocument(minidom.Document): + def __init__(self): + minidom.Document.__init__(self) + self.encoding = '' + def writexml(self, writer, indent="", addindent="", newl="", encoding=""): + if encoding: encdstr = 'encoding="%s"' % encoding + else: encdstr = '' + writer.write('\n' % encdstr) + for node in self.childNodes: + node.writexml(writer, indent, addindent, newl)