[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
On Feb 9, 2009, at 11:20 AM, David Carlisle wrote:
Here is an example from one of my projects:
<xsl:template match="s:content" mode="tab">
<xsl:if test="not(@id='start-1.1.1') and @onnav='1' and @generate='1'">
<xsl:variable name="href">
<xsl:apply-templates select="." mode="get_page_href"/>
</xsl:variable>
<li id="{translate(@id, '.', '')}">
<a href="{$href}">
<xsl:if test="@id=$lsb_focus_nodeset/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@label"/>
<xsl:comment><![CDATA[[if IE 7]><!]]></xsl:comment>
</a>
<xsl:comment><![CDATA[<![endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]><table><tr><td><! [endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]></td></tr></table></a><! [endif]]]></xsl:comment>
</li>
</xsl:if>
</xsl:template>
<xsl:template match="s:folder" mode="tab">
<xsl:if test="@onnav='1' and @generate='1'">
<xsl:variable name="href">
<xsl:apply-templates select="." mode="get_page_href"/>
</xsl:variable>
<li id="{translate(@id, '.', '')}">
<a href="{$href}">
<xsl:if test="descendant-or-self::*[@id=$lsb_focus_nodeset/ @id]">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@label"/>
<xsl:comment><![CDATA[[if IE 7]><!]]></xsl:comment>
</a>
<xsl:comment><![CDATA[<![endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]><table><tr><td><! [endif]]]></xsl:comment>
<ul>
<xsl:apply-templates mode="tab-item"/>
</ul>
<xsl:comment><![CDATA[[if lte IE 6]></td></tr></table></a><! [endif]]]></xsl:comment>
</li>
</xsl:if>
</xsl:template>
Re: [xsl] Best approach for adding Java Script?
Subject: Re: [xsl] Best approach for adding Java Script? From: Robert Koberg <rob@xxxxxxxxxx> Date: Mon, 9 Feb 2009 11:28:24 -0500 |
On Feb 9, 2009, at 11:20 AM, David Carlisle wrote:
1. To add a comment (AS below lt IE7)
I just replied saying to use xsl:comment but I see you don't want a comment you want
<![endif]-->
which isn't a comment it;s a syntax error (not that there is any point arguing that case with IE:-) XSLt can not generate that without using disable-output-escaping
<xsl:text disable-output-escaping="yes"><![endif]--></xsl:text>
Here is an example from one of my projects:
<xsl:template match="s:content" mode="tab">
<xsl:if test="not(@id='start-1.1.1') and @onnav='1' and @generate='1'">
<xsl:variable name="href">
<xsl:apply-templates select="." mode="get_page_href"/>
</xsl:variable>
<li id="{translate(@id, '.', '')}">
<a href="{$href}">
<xsl:if test="@id=$lsb_focus_nodeset/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@label"/>
<xsl:comment><![CDATA[[if IE 7]><!]]></xsl:comment>
</a>
<xsl:comment><![CDATA[<![endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]><table><tr><td><! [endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]></td></tr></table></a><! [endif]]]></xsl:comment>
</li>
</xsl:if>
</xsl:template>
<xsl:template match="s:folder" mode="tab">
<xsl:if test="@onnav='1' and @generate='1'">
<xsl:variable name="href">
<xsl:apply-templates select="." mode="get_page_href"/>
</xsl:variable>
<li id="{translate(@id, '.', '')}">
<a href="{$href}">
<xsl:if test="descendant-or-self::*[@id=$lsb_focus_nodeset/ @id]">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@label"/>
<xsl:comment><![CDATA[[if IE 7]><!]]></xsl:comment>
</a>
<xsl:comment><![CDATA[<![endif]]]></xsl:comment>
<xsl:comment><![CDATA[[if lte IE 6]><table><tr><td><! [endif]]]></xsl:comment>
<ul>
<xsl:apply-templates mode="tab-item"/>
</ul>
<xsl:comment><![CDATA[[if lte IE 6]></td></tr></table></a><! [endif]]]></xsl:comment>
</li>
</xsl:if>
</xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re[4]: [xsl] Best approach for addi, Arthur Maloney | Thread | Re: [xsl] Best approach for adding , David Carlisle |
Re: [xsl] Best approach for adding , David Carlisle | Date | Re: [xsl] Best approach for adding , David Carlisle |
Month |
Keywords