summaryrefslogtreecommitdiff
path: root/Lib/xml
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-08-25 22:02:43 +0000
committerGeorg Brandl <georg@python.org>2005-08-25 22:02:43 +0000
commitce73d4d4a1e52ef384892638b6395f005c0fd563 (patch)
tree9d3fcebb6029c5d4800068f0e2db11273417ca98 /Lib/xml
parenta34bca58ac92a30176f629c12b5618a1838115a8 (diff)
downloadcpython-ce73d4d4a1e52ef384892638b6395f005c0fd563.tar.gz
bug [ 1262320 ] minidom.py alternate newl support is broken
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/dom/minidom.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index f17578baac..4bb4ef49ff 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -1278,15 +1278,15 @@ class DocumentType(Identified, Childless, Node):
writer.write("<!DOCTYPE ")
writer.write(self.name)
if self.publicId:
- writer.write("\n PUBLIC '%s'\n '%s'"
- % (self.publicId, self.systemId))
+ writer.write("%s PUBLIC '%s'%s '%s'"
+ % (newl, self.publicId, newl, self.systemId))
elif self.systemId:
- writer.write("\n SYSTEM '%s'" % self.systemId)
+ writer.write("%s SYSTEM '%s'" % (newl, self.systemId))
if self.internalSubset is not None:
writer.write(" [")
writer.write(self.internalSubset)
writer.write("]")
- writer.write(">\n")
+ writer.write(">"+newl)
class Entity(Identified, Node):
attributes = None
@@ -1739,9 +1739,9 @@ class Document(Node, DocumentLS):
def writexml(self, writer, indent="", addindent="", newl="",
encoding = None):
if encoding is None:
- writer.write('<?xml version="1.0" ?>\n')
+ writer.write('<?xml version="1.0" ?>'+newl)
else:
- writer.write('<?xml version="1.0" encoding="%s"?>\n' % encoding)
+ writer.write('<?xml version="1.0" encoding="%s"?>%s' % (encoding, newl))
for node in self.childNodes:
node.writexml(writer, indent, addindent, newl)