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


In reply to Getting Netscape to use a linked XSL stylesheet by AlistairFromScotland

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.