i think my favorite account in checking to make sure my cgi-script worked
in IE was when i printed out a tutorial that had xml examples half way
through the document. it had a text/plain mime type. IE basically said
"plain text? you fool! this file contains <?xml?> some where near the
middle, it must be XML, i'll just show it in my cool dhtml viewer"
"hey wait a second this file starts with plain text and has no tag,
this isn't xml, you idiot"
and then instead of showing it as plain text like i asked it errored out
and proceeded to show me exactly why it wasn't xml and where i could go to
fix the problem... 

-mike

On Tue, 26 Feb 2002, Ranga Nathan wrote:

> 
> [forwarded submission from a non-member address -- rjk]
> 
> 
> From: "Ranga Nathan" <[EMAIL PROTECTED]>
> Date: Mon, 25 Feb 2002 19:01:38 -0800
> Subject: CGI printing XML
> To: <[EMAIL PROTECTED]>
> 
> When a CGI scripts prints an XML file to IE, it renders it as plain text!!!
> But when it GETs an XML file with the xml extension it renders it with
> collapse/expand view. Wonder if anyone has an angle on this. How can one
> tell IE from a CGI to collaps/expand? I tried different mime types.. IE
> simply seems to ignore it!!!
> script is:
> #!/usr/local/bin/perl
> 
> print <<HERE;
> Content-type: text/xml
> 
> <?xml version="1.0" ?>
> <root>
>   <elem>
>      This is element one
>   </elem>
>   <elem>
>      This is element two
>   </elem>
> </root>
> HERE
> ====================================
> Ranga Nathan
> Reliance Technology
> Legacy to Web integration consultancy
> Text to web-database-spreadsheet, datamarts
> ADABAS, NATURAL, Perl, Apache, Linux, Wintel solutions
> Tel: 617 884 9801 Fax: 781 623 5646
> http://www.cobolexplorer.com - cobol listings on the web
> http://www.any2xml.com - text to anything
> http://www.goreliance.com
> http://www.adaexplorer.com - ADAREP on the web + stats
> 

Reply via email to