[Fedora-suds-list] preserving space?

Brodie Thiesfield brofield+suds at gmail.com
Tue Dec 22 14:54:16 UTC 2009


Hi Jeff,

Thanks for the update. I'll upgrade to the later version when I can.

Regards,
Brodie


On Tue, Dec 22, 2009 at 11:51 PM, Jeff Ortel <jortel at redhat.com> wrote:
> Hey Brodie,
>
> Well, what you're seeing is kind of intentional.  Since the early days, the
> suds sax parser has trimmed the text.  This comes from when the sax package
> was written and the XML documents used for testing were formatted and the
> leading and trailing newlines and whitespace was annoying and troublesome.
>  But, in the context of soap messages, trimming the text just causes
> problems (as you've noted).  Also, soap messages are rarely (probably never)
> formatted so there is really not benefit to trimming.
>
> So, in r630, I discontinued trimming the text in the sax parser.  r630 has
> been released in 0.3.9 beta.
>
> Thanks for bringing this to my attention.
>
> Regards,
>
> Jeff
>
> On 12/22/2009 06:02 AM, Brodie Thiesfield wrote:
>>
>> Hi all,
>>
>> New to suds and I'm seeing some strange behaviour with whitespace only
>> contents.
>>
>> I have an element being returned from the soap server that consists of
>> just a single space.
>>  <text>  </text>
>>
>> The WSDL defines this as:
>>      <element name="text" type="xsd:string" minOccurs="0"
>> maxOccurs="1" nillable="true"/>
>>
>> In the debug log I can see that the space has been returned by the
>> server, although I don't understand any of the rest of the log (is
>> there a way to log only the messages?)
>>
>> When accessing this element though, it has the value of None. i.e.
>> this code appends 'None' to the string:
>>         if part.text == None:
>>             txn += "<None>";
>>         else:
>>             txn += part.text
>>
>> Surely this is not expected behaviour? Is there some setting that I am
>> missing to prevent this? Is there a way to make it return the space?
>>
>> Regards,
>> Brodie
>>
>> Note: Using suds 0.3.8 GA on Windows with python 2.6.4
>>
>> _______________________________________________
>> fedora-suds-list mailing list
>> fedora-suds-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
>




More information about the fedora-suds-list mailing list