Netscape 7, xsl, js problem

Discussion in 'XML' started by Pavel, Apr 20, 2004.

  1. Pavel

    Pavel Guest

    Greetings to all -

    I've noticed that my xsl transformation does not work in Netscape 7.
    It worked fine in Netscape 6.1, or if html file is generated using
    xalan (and it works in IE 5, not that it's important :)

    If I load my xml file in Netscape 7 it goes into the load loop and
    never comes out of it. I've been able to localize the problem. It's
    related to the document.write() JS call inside the template. If I
    would comment out the JS call then everything works fine.

    Here is the stylesheet file called test.xsl with relevant code in it:

    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:eek:utput method="html" indent="yes" />

    <xsl:template match="/">
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>

    <script language="JavaScript">
    document.write(document.lastModified);
    </script>

    </body>
    </html>
    </xsl:template>

    </xsl:stylesheet>

    Any xml file will do but here is the one that I've used:
    --cut--
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>

    <test>
    </test>
    --cut--

    Any idea why it does not work with this JS call in Netscape 7 ?
    Thanks
    Pavel
     
    Pavel, Apr 20, 2004
    #1
    1. Advertising

  2. Pavel wrote:


    > If I load my xml file in Netscape 7 it goes into the load loop and
    > never comes out of it. I've been able to localize the problem. It's
    > related to the document.write() JS call inside the template. If I
    > would comment out the JS call then everything works fine.


    Netscape doesn't support the use of document.write in the result
    document of an XSLT transformation, see issue 4. in the faq
    http://www.mozilla.org/projects/xslt/faq.html
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Apr 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    513
  2. Mickey Segal
    Replies:
    1
    Views:
    690
    Mickey Segal
    May 21, 2004
  3. mali djuro

    xml, xsl, css ... in netscape

    mali djuro, Sep 2, 2003, in forum: HTML
    Replies:
    8
    Views:
    483
    mali djuro
    Sep 4, 2003
  4. Replies:
    1
    Views:
    3,688
    A. Bolmarcich
    May 27, 2005
  5. yaktipper
    Replies:
    10
    Views:
    304
    Richard Cornford
    Jul 10, 2003
Loading...

Share This Page