Extra carriage returns in outputed XML

9 views
Skip to first unread message

shocks

unread,
Mar 15, 2008, 4:51:45 AM3/15/08
to Django users
Hi

I'm outputing XML from Django and it's having an undesired effect of
an additional carriage return when it's read by my Flash website.
Flash reads a line break as follows:

<copy><![CDATA[This is paragraph 1
This is paragraph 2]]></copy>

The ouputed text from Flash would be:
This is paragraph 1

This is paragraph 2


However Django is exporting (by design) like this:
<copy><![CDATA[This is paragraph 1

This is paragraph 2]]></copy>

And the outputed text from Flash has the additional line feed:
This is paragraph 1


This is paragraph 2

Is there a way to alter this in Django? The current hack is to remove
the line feed between paragraphs when entering copy in the Admin
tool. But that's not a great solution. I also get the same problem
when I use a wrapper protocol (AMF) so I know it's not the way I'm
constructing the XML / it's being read.

Thanks,
Ben

shocks

unread,
Mar 15, 2008, 4:53:23 AM3/15/08
to Django users
Sorry - in this Django example it should be:

This is paragraph 1


This is paragraph 2


shocks

unread,
Mar 15, 2008, 4:54:40 AM3/15/08
to Django users
OK - Google is removing the extra line feed! But I think you get what
I'm talking about... :)

Malcolm Tredinnick

unread,
Mar 15, 2008, 5:02:32 AM3/15/08
to django...@googlegroups.com

On Sat, 2008-03-15 at 01:51 -0700, shocks wrote:
[...]

> Is there a way to alter this in Django?

We can't read minds and you don't explain how you are generating the
output from Django. So you'll need to include some more information.

Malcolm

--
I just got lost in thought. It was unfamiliar territory.
http://www.pointy-stick.com/blog/

shocks

unread,
Mar 16, 2008, 5:12:02 AM3/16/08
to Django users
Well there's not a whole lot of mind reading to be done. As I said I
tried it with AMF so I'm using an RPC to get the object from Django
and the gateway method is returning the line feed (as it should
because that's what is in the text field in the admin tool). What I
ended up doing it using a regular expression to remove the line
feed.

Ben
Reply all
Reply to author
Forward
0 new messages