[Zope] removing newline character from returned python string
Andreas Jung
Andreas Jung <lists@andreas-jung.com>
Fri, 21 Jun 2002 15:20:32 -0400
.strip() only removes leading and trailing whitespaces.
To remove '\n' within the document you should something like
XML=XML.replace('\n','').
-aj
--On Friday, June 21, 2002 13:33 -0500 Jon Erickson
<jon.erickson@neicoltech.org> wrote:
> I have a python script that transforms the results of a zsql method into
> xml. The script builds the xml in a python string and returns that
> string as the scripts output. The problem I have is that the string
> contains a newline character (\n) which corrupts the xml. I made sure
> to strip the string before it's returned...
>
> XML = XML.strip()
> return XML
>
> ... but the output always contains the newline character. Does anyone
> have suggestions on how I could fix this?
>
> Thanks,
>
> Jon
>
>
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
---------------------------------------------------------------------
- Andreas Jung http://www.andreas-jung.com -
- EMail: andreas at andreas-jung.com -
- "Life is too short to (re)write parsers" -
---------------------------------------------------------------------