summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-08-25 22:02:43 (GMT)
committerGeorg Brandl <georg@python.org>2005-08-25 22:02:43 (GMT)
commit175a7dcf6588f41df1ea99f9180a930d37224598 (patch)
tree13bca208636404700877dc883603dba2bd8c4250 /Lib/xml
parent8fc18a2010ae640fb4a1d209686affd76311e774 (diff)
downloadcpython-175a7dcf6588f41df1ea99f9180a930d37224598.zip
cpython-175a7dcf6588f41df1ea99f9180a930d37224598.tar.gz
cpython-175a7dcf6588f41df1ea99f9180a930d37224598.tar.bz2
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 f17578b..4bb4ef4 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)