That seems perfectly reasonalbe to me, you just need to put some logic in the <xsl:for-each> blocks (and then close them). I would recommend using an <xsl:template> to combine the code so you only have to write it once...
<xsl:template name="doSomething"><!-- This just prints the nodeName of item --> <xsl:param name="item"/> <p><xsl:value-of select="$item/@nodeName"/></p> </xsl:template> </xsl:stylesheet>
Choose and For-each
A stupid question I am sure, but here is what I am trying to do:
<xsl:choose> <xsl:when test="$prev_dates=1"> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1' and(umbraco.library:FormatDateTime(data[@alias='dato'],'yyyyMMdd') >= umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMdd'))]"> </xsl:when> <xsl:otherwise> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1' and(umbraco.library:FormatDateTime(data[@alias='dato'],'yyyyMMdd') < umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMdd'))]"> </xsl:otherwise> </xsl:choose>
.. I know this doesnt work, but what are the proper method to do this in XSLT?
Thanks in advance!
That seems perfectly reasonalbe to me, you just need to put some logic in the <xsl:for-each> blocks (and then close them). I would recommend using an <xsl:template> to combine the code so you only have to write it once...
Great, thanks!!
is working on a reply...