It supposed to be very simple, I want to limit my results in this for-each but also want to check a node. For some reason it doesn't work combining them both in one statement?
I have a checkbox (recommended) which can be ticked to 'Yes'. When I remove the limit 5 in the for-each, it shows all the items that have recommended on 'Yes'. When I remove the 'recommended = 'Yes'' from the for-each test, I got the last items limited till 5. Putting them together results in nothing. They both don't work anymore. I want to filter them on Recommended 'Yes' and I want to limit them to 5.
<xsl:for-each select="data/resorts/entry[position() < 2 and recommended = 'Yes']">
<xsl:sort select="top-pick-order" case-order="upper-first"/>
<a href="{$root}/koh-lipe-resorts/resort-view/{resort-name/@handle}">
<div id="top-pick-item">
<div id="top-pick-text-short">
<h3 class="item-heading"><xsl:value-of select="resort-name"/></h3>
<p>
<xsl:call-template name="truncate">
<xsl:with-param name="value" select="resort-description" mode="formatted"/>
<xsl:with-param name="length" select="110" />
</xsl:call-template>
</p>
</div>
</div>
</a>
</xsl:for-each>