|
-
Getting Error: malformed header from script. Bad header=<?xml version="1.0" ??
I am creating a CGI script to display data dynamically in XML format on Internet Explorer, following is my code:-
use strict;
use CGI ':standard';
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use XML::Simple();
use XML::Writer;
print "Content-type: text/xml\n\n";
print "<?xml version=\"1.0\"?>\n";
my $writer = new XML::Writer();
$writer->xmlDecl();
$writer->startTag('html');
$writer->startTag('body');
foreach my $ver (keys (%data_hash)) {
$writer->startTag($ver);
$writer->characters($data_hash{$ver});
$writer->endTag($ver);
}
$writer->endTag('html');
$writer->endTag('body');
but I am getting following error message:-
malformed header from script. Bad header=<?xml version="1.0" encoding=":
Can anyone help me in resolving this issue.
__________________
-
I am facing the same problem with ActivePerl 5.10.0 XML::Writer 0.603 and apache 2.2? Any good luck to come around the problem....
-
Looks like it isn't recognising the end of the headers. You might try \r\n\r\n instead of \n\n
Stephen
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks