# HG changeset patch # User paulb # Date 1181085536 0 # Node ID 5429063823d3af59f270cb7e21a6e10375a94069 # Parent d16b152c2d2139ae86e1576a9ed8608eeeb7b9b6 [project @ 2007-06-05 23:18:56 by paulb] Fixed CR character handling, removing such characters (typically occurring in CRLF sequences) so that recipients of the eventual documents do not double up newlines. diff -r d16b152c2d21 -r 5429063823d3 XSLForms/Fields.py --- a/XSLForms/Fields.py Tue Jun 05 23:17:54 2007 +0000 +++ b/XSLForms/Fields.py Tue Jun 05 23:18:56 2007 +0000 @@ -121,7 +121,9 @@ if type(value) == type(""): value = unicode(value, encoding=self.encoding) - node.setAttributeNS(EMPTY_NAMESPACE, t[0], value) + # Remove CR characters. + + node.setAttributeNS(EMPTY_NAMESPACE, t[0], value.replace("\r", "")) break elif len(t) == 2: @@ -156,7 +158,9 @@ if type(subvalue) == type(""): subvalue = unicode(subvalue, encoding=self.encoding) - subnode.setAttributeNS(EMPTY_NAMESPACE, t[2], subvalue) + # Remove CR characters. + + subnode.setAttributeNS(EMPTY_NAMESPACE, t[2], subvalue.replace("\r", "")) def complete_selectors(self, selectors, fields, documents, create):