in.diff.orig 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. ***************
  4. *** 467,472 ****
  5. --- 467,479 ----
  6. dom.unlink()
  7. self.confirm(domstr == str.replace("\n", "\r\n"))
  8. + def testPrettyTextNode(self):
  9. + str = '<A>B</A>'
  10. + dom = parseString(str)
  11. + dom2 = parseString(dom.toprettyxml())
  12. + self.confirm(dom.childNodes[0].childNodes[0].toxml()==
  13. + dom2.childNodes[0].childNodes[0].toxml())
  14. +
  15. def testProcessingInstruction(self):
  16. dom = parseString('<e><?mypi \t\n data \t\n ?></e>')
  17. pi = dom.documentElement.firstChild
  18. *** a/Lib/xml/dom/minidom.py Fri Sep 30 08:46:25 2011 +0300
  19. --- b/Lib/xml/dom/minidom.py Sat Oct 01 21:02:49 2011 +0300
  20. ***************
  21. *** 836,842 ****
  22. _write_data(writer, attrs[a_name].value)
  23. writer.write("\"")
  24. if self.childNodes:
  25. ! writer.write(">%s"%(newl))
  26. for node in self.childNodes:
  27. node.writexml(writer,indent+addindent,addindent,newl)
  28. writer.write("%s</%s>%s" % (indent,self.tagName,newl))
  29. --- 836,844 ----
  30. _write_data(writer, attrs[a_name].value)
  31. writer.write("\"")
  32. if self.childNodes:
  33. ! writer.write(">")
  34. ! if self.childNodes[0].nodeType != Node.TEXT_NODE: # Strict check
  35. ! writer.write(newl)
  36. for node in self.childNodes:
  37. node.writexml(writer,indent+addindent,addindent,newl)
  38. writer.write("%s</%s>%s" % (indent,self.tagName,newl))
  39. ***************
  40. *** 1061,1067 ****
  41. return newText
  42. def writexml(self, writer, indent="", addindent="", newl=""):
  43. ! _write_data(writer, "%s%s%s"%(indent, self.data, newl))
  44. # DOM Level 3 (WD 9 April 2002)
  45. --- 1063,1069 ----
  46. return newText
  47. def writexml(self, writer, indent="", addindent="", newl=""):
  48. ! _write_data(writer, self.data)
  49. # DOM Level 3 (WD 9 April 2002)