|Syntactic Confectionery Delight|
Getting Netscape to use a linked XSL stylesheetby AlistairFromScotland (Initiate)
|on Sep 22, 2002 at 20:15 UTC||Need Help??|
AlistairFromScotland has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone help? I'm baffled!
I have a Perl CGI script that takes input from an HTML form and generates an on-the-fly XML page by extracting nodes from an XML file on the server - the choice of nodes varying, depending on what the user selects on the form. The Perl script prints the new XML page and sends it back to the browser with the following 1st two lines:
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="http://localhost/my-stuff/stylesheet.xsl"?>
IE6 does what I want it to - which is: it notices the reference to the XSL stylesheet, so it uses that file to transform/format the XML into XHTML, resulting in a nice-looking web page.
However, Netscape 6 ignores the stylesheet and just displays the XML. But if I save that same XML as a file with a .xml extension it does the right thing and uses the XSL stylesheet.
My question is: How do I get Netscape to treat what I send it from the Perl script in the same way it would if it was reading the same thing from a save XML file? Netscape 6 obviously knows how to use XSL, but it just doesn't want to do it when it gets passed the XML from a Perl CGI script.
How do I get Netscape to act like IE? How do I get it to use the linked XSL file?
Thanks in advance Alistair