2014-09-04 7 views
0

Я пытаюсь добавить эти условные комментарии:Генерация IE-версия условного блока комментариев от XSLT

<!doctype html> 
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]--> 
<!--[if IE 7 ]> <html class="ie7"> <![endif]--> 
<!--[if IE 8 ]> <html class="ie8"> <![endif]--> 
<!--[if IE 9 ]> <html class="ie9"> <![endif]--> 
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]--> 
<head> 

в файл XSL:

<xsl:comment> 
     <![CDATA[[if lt IE 7 ]> <head class="ie6"> <![endif]]]> 
     <![CDATA[[if IE 7 ]> <head class="ie7"> <![endif]]]> 
     <![CDATA[[if IE 8 ]> <head class="ie8"> <![endif]]]> 
     <![CDATA[[if IE 9 ]> <head class="ie9"> <![endif]]]> 
     <![CDATA[[if (gt IE 9)|!(IE)]><!--> <head class=""> <!--<![endif]]]> 
    </xsl:comment> 

Существует что-то не так с моим синтаксисом XSL хотя , Может ли кто-нибудь это увидеть?

ответ

4

Каждый из этих условных должны были бы быть отделенным <xsl:comment>

<xsl:comment><![CDATA[[if lt IE 7 ]> <html class="ie6"> <![endif]]]></xsl:comment> 
<xsl:comment><![CDATA[[if IE 7 ]> <html class="ie7"> <![endif]]]></xsl:comment> 
<xsl:comment><![CDATA[[if IE 8 ]> <html class="ie8"> <![endif]]]></xsl:comment> 
<xsl:comment><![CDATA[[if IE 9 ]> <html class="ie9"> <![endif]]]></xsl:comment> 
<xsl:comment>[if (gt IE 9)|!(IE)]></xsl:comment> 
<html class=""> <xsl:comment><![endif]</xsl:comment> 
    <!-- rest of the content goes here --> 
</html> 
+0

Спасибо - до сих пор не работают с кодом, хотя –

+0

Определения «не работает» - то, что выход делает это на самом деле производит? –

+0

Интересно, нужно ли отключать выходное экранирование. –