Changes by Francesco Sechi :
--
nosy: -sechi_francesco
___
Python tracker
<http://bugs.python.org/issue5752>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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.
--
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
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
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.
Changes by Francesco Sechi :
--
nosy: +sechi_francesco
___
Python tracker
<http://bugs.python.org/issue5762>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
Changes by Francesco Sechi :
--
nosy: +sechi_francesco
___
Python tracker
<http://bugs.python.org/issue5752>
___
___
Python-bugs-list mailing list
Unsubscribe:
15 matches
Mail list logo