if IE
This is an open discussion with 6 replies, filed under XSLT.
Search
This should do it:
<xsl:comment><![CDATA[[if IE 7]> <link rel="stylesheet" href="css/ie7.css" media="screen" /> <![endif]]]> </xsl:comment>
Or if you need to use variables or other XSL elements within the comment, you can use the following:
<xsl:comment><![CDATA[[if lt IE 8]><script type="text/javascript" src="]]><xsl:value-of select="php:function('mtime', 'layout/js/funny-old-ie.js')"/><![CDATA["></script><![endif]]]></xsl:comment>
There’s an XSLT Utility for conditional comments…
It goves you the option to specify the IE version, and advises the above also.
I tried the code from mqchen and it doesn’t work properly.
This is the code from the output:
<!-- [if IE 7]> <link rel="stylesheet" href="css/ie7.css" media="screen" /> <![endif] -->
Sorry about that. The indents were wrong. Try something like this (ie. no whitespace after the opening comment tag and none before the closing one:
<xsl:comment><![CDATA[[if IE]> <link rel="stylesheet" type="text/css" href="{$workspace}/css/ie.css" media="all" /> <![endif]]]></xsl:comment>
Alright that was the issue, thanks.
Create an account or sign in to comment.
How can I use the if IE tag inside the XSLT douments?
For example the code below: