123456789101112131415161718192021222324252627282930313233343536
  1. --- a/Lib/test/test_minidom.py Fri Sep 30 08:46:25 2011 +0300
  2. +++ b/Lib/test/test_minidom.py Sat Oct 01 21:02:49 2011 +0300
  3. @@ -467,6 +467,13 @@
  4. 467  dom.unlink() 467  dom.unlink()
  5. 468  self.confirm(domstr == str.replace("\n", "\r\n")) 468  self.confirm(domstr == str.replace("\n", "\r\n"))
  6.   469 
  7.   470  def testPrettyTextNode(self):
  8.   471  str = '<A>B</A>'
  9.   472  dom = parseString(str)
  10.   473  dom2 = parseString(dom.toprettyxml())
  11.   474  self.confirm(dom.childNodes[0].childNodes[0].toxml()==
  12.   475  dom2.childNodes[0].childNodes[0].toxml())
  13. 469  476 
  14. 470  def testProcessingInstruction(self): 477  def testProcessingInstruction(self):
  15. 471  dom = parseString('<e><?mypi \t\n data \t\n ?></e>') 478  dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
  16. 472  pi = dom.documentElement.firstChild 479  pi = dom.documentElement.firstChild
  17. --- a/Lib/xml/dom/minidom.py Fri Sep 30 08:46:25 2011 +0300
  18. +++ b/Lib/xml/dom/minidom.py Sat Oct 01 21:02:49 2011 +0300
  19. @@ -836,7 +836,9 @@
  20.  836  _write_data(writer, attrs[a_name].value)  836  _write_data(writer, attrs[a_name].value)
  21.  837  writer.write("\"")  837  writer.write("\"")
  22.  838  if self.childNodes:  838  if self.childNodes:
  23.  839  writer.write(">%s"%(newl))  839  writer.write(">")
  24.    840  if self.childNodes[0].nodeType != Node.TEXT_NODE: # Strict check
  25.    841  writer.write(newl)
  26.  840  for node in self.childNodes:  842  for node in self.childNodes:
  27.  841  node.writexml(writer,indent+addindent,addindent,newl)  843  node.writexml(writer,indent+addindent,addindent,newl)
  28.  842  writer.write("%s</%s>%s" % (indent,self.tagName,newl))  844  writer.write("%s</%s>%s" % (indent,self.tagName,newl))
  29. @@ -1061,7 +1063,7 @@
  30. 1061  return newText 1063  return newText
  31. 1062  1064 
  32. 1063  def writexml(self, writer, indent="", addindent="", newl=""): 1065  def writexml(self, writer, indent="", addindent="", newl=""):
  33. 1064  _write_data(writer, "%s%s%s"%(indent, self.data, newl)) 1066  _write_data(writer, self.data)
  34. 1065  1067 
  35. 1066  # DOM Level 3 (WD 9 April 2002) 1068  # DOM Level 3 (WD 9 April 2002)
  36. 1067  1069