This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: HTML <script> tag
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Zakon, Stuart" <stuart_zakon at medcohealth dot com>
- Cc: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 29 Aug 2002 10:11:57 +0100
- Subject: Re: [xsl] HTML <script> tag
- Organization: Jeni Tennison Consulting Ltd
- References: <B9AB61562E23D2118F1C0001FA3778CF0D3AE4A3@usfrmx00.medco.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Stuart,
> I am including the following line in an XSLT template:
>
> <script type="text/javascript" language="JavaScript" src="viewSource.js">
> </script>
>
> I use the latest Xalan for Java and the problem is that since the
> text node of the element is empty, the XSLT engine generates the
> following:
>
> <script type="text/javascript" language="JavaScript" src="viewSource.js" />
>
> Well that is fine but for some bizarre reason neither the latest
> version of IE nor Mozilla recognize this HTML and, worse, it causes
> the whole page to render blank!
For what it's worth, when I have the same problem when creating
*XHTML* (when I don't want to use the 'html' output method), I create
a comment inside the script element so that it has some content, and
this seems to work. In the XSLT:
<script type="text/javascript" language="JavaScript"
src="viewSource.js">
<xsl:comment>Comment added so script is recognised</xsl:comment>
</script>
which comes out as:
<script type="text/javascript" language="JavaScript"
src="viewSource.js">
<!--Comment added so script is recognised-->
</script>
and seems to work.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list