From 3e34e48598eba306261b4401e4735d18c1eec673 Mon Sep 17 00:00:00 2001 From: jortel Date: Mon, 3 May 2010 14:41:38 +0000 Subject: Fixed ticket #313. Fix attribute handling for TextAppender. --- suds/__init__.py | 2 +- suds/mx/appender.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/suds/__init__.py b/suds/__init__.py index 6a9cacc..b403d43 100644 --- a/suds/__init__.py +++ b/suds/__init__.py @@ -27,7 +27,7 @@ import sys # __version__ = '0.4' -__build__="(beta) R671-20100405" +__build__="(beta) R674-20100503" # # Exceptions diff --git a/suds/mx/appender.py b/suds/mx/appender.py index 0501415..206abc0 100644 --- a/suds/mx/appender.py +++ b/suds/mx/appender.py @@ -191,7 +191,7 @@ class PrimativeAppender(Appender): if content.tag.startswith('_'): attr = content.tag[1:] value = tostr(content.value) - if value is not None and len(value): + if value: parent.set(attr, value) else: child = self.node(content) @@ -305,6 +305,12 @@ class TextAppender(Appender): """ def append(self, parent, content): - child = self.node(content) - child.setText(content.value) - parent.append(child) + if content.tag.startswith('_'): + attr = content.tag[1:] + value = tostr(content.value) + if value: + parent.set(attr, value) + else: + child = self.node(content) + child.setText(content.value) + parent.append(child) -- cgit v1.2.1