Subject: [xsl] IE's conditional comments in xslt From: "Manfred Staudinger" <manfred.staudinger@xxxxxxxxx> Date: Fri, 3 Mar 2006 13:41:41 -0800 |
I would like to propose a xslt conform solution for Conditional Comments The proposed solution uses two downlevel-hidden CC's <!--[if expression]> HTML <![endif]--> and one downlevel-revealed CC <![if expression]> HTML <![endif]> and consists of: 1. the test for the system-property, to make sure that only MS's IE will see it. 2. two xslt comment elements with the conditional html in between 3. each one of the xslt comment elements has text inside, which starts with "[if IE]>" and ends with "<![endif]", forming a downlevel-hidden CC. 4. inside the downlevel-hidden CC's there is the start "<![if lte IE 6]>" and the end "<![endif]>" of the downlevel-revealed CC. <xsl:if test="system-property('xsl:vendor')='Microsoft'"> <xsl:comment><xsl:text>[if IE]><![if lte IE 6]><![endif]</xsl:text></xsl:comment> <!-- "lte IE 6" = "expression" --> <!-- html gets executed by any IE for which the "expression" is true --> <xsl:comment><xsl:text>[if IE]><![endif]><![endif]</xsl:text></xsl:comment> </xsl:if> The only variable part in this example is "lte IE 6", which I'll call "expression for this discussion. If the "expression" is true for your browser, the the html between those two comments get executed. In the example given, its true for IE 6, IE 5.5 and IE 5.0, but not for IE 7. To select for IE 6 only, use "IE 6" and so on. Manfred Staudinger For additional information http://www.positioniseverything.net/articles/multiIE.html http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp#Dow nlevel_revealed_Conditional_Comments
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Is this possible with XSL, Cindy Hunt | Thread | Re: [xsl] IE's conditional comments, Chris Burdess |
Re: [xsl] Is letting the browser tr, M. David Peterson | Date | Re: [xsl] Is letting the browser tr, M. David Peterson |
Month |