[issue5752] xml.dom.minidom does not escape CR, LF and TAB characters within attribute values

2009-05-13 Thread Francesco Sechi
Changes by Francesco Sechi : -- nosy: -sechi_francesco ___ Python tracker <http://bugs.python.org/issue5752> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[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 <h

[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 <http://bugs.python.org/issue5752> ___ ___ Python-bugs-list m

[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 <http://bugs.python.org/issue5752> ___ ___ Python-bugs-list m

[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

[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. --

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-10 Thread Francesco Sechi
Francesco Sechi added the comment: I try to explain better what is my opinion: - If you add the attribute by using setAttribute the newlines are kept and the toxml works well - If you add the attribute by using the parsestring, passing it an XML string the newlines are replaced - Your patch

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-10 Thread Francesco Sechi
Francesco Sechi added the comment: I think that the problem is: the xmldoc1 has the newline or not? If it hasn't your patch works only in the particular case you pass a toxml return value to 'parsestring'. If I pass an XML string with newlines it doesn't work. So your sol

[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-05-06 Thread Francesco Sechi
Francesco Sechi added the comment: I'm not able to reproduce the issue. Why don't you submit the unit test that generates the problem? Thanks -- ___ Python tracker <http://bugs.python.

[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-05-06 Thread Francesco Sechi
Changes by Francesco Sechi : -- nosy: +sechi_francesco ___ Python tracker <http://bugs.python.org/issue5762> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-06 Thread Francesco Sechi
Francesco Sechi added the comment: Don't worry, I'm a newer too. No, your solution does not work, because the method you refer (_write_data) is called by the toxml() function, but the newline is replaced with a whitespace by the parsestring() function. The parsestring function, as

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-04 Thread Francesco Sechi
Francesco Sechi added the comment: Ok, I've tried to solve this problem, but I think that the keyword 'easy' is not suitable for this kind of task, because it is necessary to modify the expat module that is very complex. -- ___ Python

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-02 Thread Francesco Sechi
Changes by Francesco Sechi : Added file: http://bugs.python.org/file13837/test_toxml.py ___ Python tracker <http://bugs.python.org/issue5752> ___ ___ Python-bugs-list m

[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-05-02 Thread Francesco Sechi
Changes by Francesco Sechi : -- nosy: +sechi_francesco ___ Python tracker <http://bugs.python.org/issue5752> ___ ___ Python-bugs-list mailing list Unsubscribe: