[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: IE's conditional comments in xslt

Subject: RE: IE's conditional comments in xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 3 Mar 2006 21:58:56 -0000
xslt if expression
> I would like to propose a xslt conform solution for 
> Conditional Comments

Would you like to describe the problem you are trying to solve, and the
constraints on the solution, that prevent you using XML markup to achieve
this?

Note that XSLT 2.0 has compile-time conditionals achieved through a use-when
attribute. Why doesn't this work for you?

Michael Kay
http://www.saxonica.com/


> 
> 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 "&lt;![endif]", forming a 
> downlevel-hidden CC.
> 4. inside the downlevel-hidden CC's there is the start 
> "&lt;![if lte IE 6]>" and
> the end "&lt;![endif]>" of the downlevel-revealed CC.
> 
> <xsl:if test="system-property('xsl:vendor')='Microsoft'">
> <xsl:comment><xsl:text>[if IE]>&lt;![if lte IE
> 6]>&lt;![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]>&lt;![endif]>&lt;![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/ccomm
> ent_ovw.asp#Downlevel_revealed_Conditional_Comments

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.