---
title: "How to IE Conditional Comment in XSLT 1.0 inside tag?"  
description: "How to IE Conditional Comment in XSLT 1.0 inside tag?"  
author: "Anonymous User"  
published: 2014-11-06  
updated: 2014-11-06  
canonical: https://www.mindstick.com/forum/2527/how-to-ie-conditional-comment-in-xslt-1-0-inside-tag  
category: "c#"  
tags: ["c#", "xslt", "xslt-2.0"]  
reading_time: 2 minutes  

---

# How to IE Conditional Comment in XSLT 1.0 inside tag?

How to display [title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars) (not as [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) comment) for IE6 only, if this line of [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) <a title="" href="#">some [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions)</a> is in xsl [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp)?

The [options](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas) below don't work:

```
<a <![CDATA[[if IE 6]>title="hi"<![endif]]]> href="#">some text</a>

<a &lt;![if IE 6]&gt;"title="hi"&lt;![endif]&gt; href="#">some text</a>
```

## Replies

### Reply by Royce Roy

I'm not aware of any conditional IE constructs other than those given in an HTML comment. To insert comments in XSL, you use <xsl:comment>:

```
<xsl:comment><![CDATA[[if IE 6]>
    Special instructions for IE 6 here
    <![endif]
    ]]>
</xsl:comment>
```

There is a specific reason why the CDATA follows the <xsl:comment on the same line here. IE does not recognize these comments unless the characters <!--[if IE 6]> are contiguous on a single line. The remaining portions, including the endif, can apparently be spread out onto succeeding lines.

However, since you cannot put an HTML comment in the middle of a tag, as you were trying to do. Therefore, you will have to provide alternate versions of the entire <a> tag:

```
<xsl:comment><![CDATA[[if IE 6]>
    <a title="hi" href="#">some text</a>
    <![endif]]]>
</xsl:comment>

<xsl:comment><![CDATA[[if gt IE 6]>
    <a href="#">some text</a>
    <![endif]]]>
</xsl:comment>
```

However, please note this [MS link](http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx):

> **Important** As of Internet Explorer 10, conditional comments are no longer supported by standards mode.


---

Original Source: https://www.mindstick.com/forum/2527/how-to-ie-conditional-comment-in-xslt-1-0-inside-tag

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
