Re: Unwanted \n in output

2001-04-16 Thread G.W. Haywood

Hi there,

On Sat, 14 Apr 2001, willems Luc wrote:

 I have some Apache::ASP scripts that work like a XML::RPC
[snip]
 One of my scrips has a problem that in the response , 7  times a '\n' 
 charecter is put before the actual XML text

Have you got some % # comments % in a template or something like that?
Sometimes you have to fiddle with the exact location of the % and % tags
to get the whitespace just right.

HTH

73,
Ged.




Re: Unwanted \n in output

2001-04-16 Thread Joshua Chamas

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.com1-714-625-4051



Re: Unwanted \n in output

2001-04-16 Thread Andrew Ho

Hello,

WLOne of my scrips has a problem that in the response , 7 times a '\n'
WLcharecter is put before the actual XML text (seen by using ethereal ).
WLThis confuses my clients XML parser (M$ parser ).

Actually, I think you are misdiagnosing your problem. The "7\n" that you
are seeing in your packet sniff sounds like a chunked Transfer-Encoding
byte size (check RFC 2616, the HTTP 1.1 specification, and read up on
chunked Transfer-Encoding). This would be perfectly normal in the case
that Apache doesn't know the Content-Length to send (which for scripts, it
won't unless you set it yourself).

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--