[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-13 Thread Tomalak
Tomalak added the comment: I changed the patch to include support for TAB characters, which were also left unencoded before. Also I switched encoding from ' ' etc. to ' '. This is equivalent, but the spec uses the latter variant. -- ___ Python track

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-13 Thread Tomalak
Changes by Tomalak : Added file: http://bugs.python.org/file13977/minidom.patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-13 Thread Tomalak
Changes by Tomalak : Removed file: http://bugs.python.org/file13919/minidom.patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-13 Thread Tomalak
Tomalak added the comment: Daniel Diniz: The proposed behaviour is correct: http://www.w3.org/TR/2000/WD-xml-c14n-2119.html#charescaping "In attribute values, the character information items TAB (#x9), newline (#xA), and carriage-return (#xD) are represented by " ", " ", and " " respect

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-13 Thread Tomalak
Tomalak added the comment: Francesco, > if you want to encode the newline character, > this should be done by both parseString and > setAttribute methods. Otherwise, the > behaviour is not symmetric. I believe you still don't see the issue. The behaviour is not symmetric *now*. You store a

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-12 Thread Francesco Sechi
Francesco Sechi added the comment: My position is: if you want to encode the newline character, this should be done by both parseString and setAttribute methods. Otherwise, the behaviour is not symmetric. My patch translates the newline character with a whitespace in the setAttribute method, be

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Daniel Diniz
Changes by Daniel Diniz : -- priority: -> normal stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list mailin

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Daniel Diniz
Daniel Diniz added the comment: Francesco, Your patch still doesn't allow one to add a multiline attribute values as Tomalak describes: "The catch: This leads to an actual data loss if I *wanted* to store newline characters in an attribute -- unless the newline characters are properly encoded. E

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi added the comment: I have uploaded a test script that shows that, without my patch, the methods setAttribute and parseString work differently; adding my patch, the behaviour is symmetric. -- ___ Python tracker

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Changes by Francesco Sechi : Added file: http://bugs.python.org/file13960/test_toxml.py ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Changes by Francesco Sechi : Removed file: http://bugs.python.org/file13837/test_toxml.py ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi added the comment: A solution for this issue could be to replace the setAttribute method as follow: - d["value"] = d["nodeValue"] = value + d["value"] = d["nodeValue"] = value.replace('\n',' ') NOTE: I didn't do a patch, because I don't know which python version you are using.

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi added the comment: All right, now I understand, thanks. But I think that, for internal class coherence, it is necessary not to modify toxml method, but the 'setAttribute' one, because this is the source of the problem. -- ___ Python t

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-10 Thread Tomalak
Changes by Tomalak : -- title: xml.dom.minidom does not handle newline characters in attribute values -> xml.dom.minidom does not escape newline characters within attribute values ___ Python tracker ___