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

Re: Using IE's CC (Conditional Comments) inside an XSL

Subject: Re: Using IE's CC (Conditional Comments) inside an XSL file.
From: Nick Fitzsimons <nick@xxxxxxxxxxxxxx>
Date: Sat, 17 Jun 2006 17:12:37 +0100
Re:  Using IE's CC (Conditional Comments) inside an XSL
Stephen Cunliffe wrote:
Hi all,

I did check the FAQ, and scoured the Net but I was unable to find a good, workable answer for this.

I want to, in my XSL, insert a CC for IE6, that inserts a script tag, if it is IE.

E.g. this is the rendered result of what I want.

<!--[if IE 6]>
<script src="foo.js"></script>
<![endif]-->


Hi Stephen,


On my web site I have an article about this very issue, including an XSLT template you can call to produce IE conditional comments. It takes a qualifier (e.g "IE 6" or "lte IE 6") and a result tree fragment as parameters; there's a (hopefully clear) explanation of how to use it, and an example document. You can find the post at:
<http://www.nickfitz.co.uk/2005/10/27/ie-conditional-comments-in-xslt-10/>
and the demo at
<http://www.nickfitz.co.uk/xslt/cc/ConditionalCommentDemo.xml>
which uses
<http://www.nickfitz.co.uk/xslt/cc/ConditionalCommentDemo.xsl>
from which you can copy the template.


Note that a recent WordPress upgrade seems to have messed up some of the markup in the article. I think I've fixed it now but it's safer to grab the code from that .xsl file.

HTH,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/

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.