[Israel.pm] returning XML from CGI

Shlomo Yona shlomo at cs.haifa.ac.il
Mon Sep 20 14:27:32 PDT 2004


Hello,

I have a CGI script that accepts some parameters from a form
and is supposed to return an XML document.

I'm able to return an HTML with the XML document inlined
(after some entity manipulation: mainly transforming < to
&lt; and > to &gt;), but I don't seem to be able to return
an XML document as the HTTP response in a way that is
recognized by the browser as an XML file.

This:

 	print header(-type=>'text/xml', charset=>'UTF-8');
 	print $xml_document

should have done the trick but all the browser shows me is a
blank page. The only way to view the actual document that
was returned is by viewing the page source.

Is there something that I'm missing here?

Thanks.


-- 
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/



More information about the Perl mailing list