XSL Conditional comments (using cdata etc) not working

admin

Administrator
Staff member
hi there,

im having some trouble at the moment using conditional comments in my xsl file, im using the same code that i've found on an uncountable number of sites and all im getting in ie7 is an error message.

heres part of the xsl code with the comments:


<xsl:comment><![CDATA[[if IE]>
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"ie.css" type="text/css" media="screen" />
<style type="text/css" media="screen">@import url("ie.css");</style>
<![endif]]]></xsl:comment>

<xsl:comment><![CDATA[[if IE 6]>
<link rel="stylesheet" href="ie6.css" type="text/css" media="screen" />
<style type="text/css" media="screen">@import url("ie6.css");</style>
<![endif]]]></xsl:comment>


and heres the error message:


The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


-----------------------------------------------

A CDATA section was not closed. Error processing resource'http://redchannel.co.uk/change-consulting/team-formatting.xsl'. ...

<xsl:comment><![CDATA[[if IE]>
----------------------^



if it doesnt come out properly after copy and pasting the pointer is pointing at the [ in front of the 'if ie'

it may well that im ignoring something very simple but its a tad annoying :)

if any more code is needed to look at just shout!

any help would be received with a massive grin :p

thanks! Adam
 
Back
Top