perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <jos...@chamas.com>
Subject Re: Unwanted "\n" in output
Date Mon, 16 Apr 2001 17:10:13 GMT
willems Luc wrote:
> 
>                 Hello everybody ,
> 
> I have some Apache::ASP scripts that work like a XML::RPC . The idea is to
> send some XML request and the response will be an answer in XML that can be
> used by the client software.
> 
> One of my scrips has a problem that in the response , 7  times a '\n'
> charecter is put before the actual XML text (seen by using ethereal ). This
> confuses my clients XML parser (M$ parser ).
> I don't know where these characters come from. The ouput i generated doesn't
> have it. I already tryed Response->Binarywrite and flushing but this doesn't
> do the trick.
> Does anybody know where this comes from ?
> 

Like Ged said, check out your <% %>, but also if you want to kill
leading white space globally, you might post process your output
in your global.asa with Script_OnFlush:

sub Script_OnFlush {
   my $out_ref = $Response->{BinaryRef};
   $$out_ref =~ s/^\s+(\<\?xml)/$1/s
}

Then set PerlSetVar BufferingOn 1 so that flush will only be called
once per script.

--Josh

_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Mime
View raw message