I need to make some kind of identifier/flag when reaching some if statements. So that I only write the <h2>
once in the for-each (Code is below):
<xsl:for-each select="$matchedNodes">
<xsl:variable name="i" select="0"/>
<xsl:variable name="j" select="0"/>
<xsl:if test="magazineDate != '' and (i < 1)">
<h2>Magasiner</h2>
i++
</xsl:if>
<xsl:if test="homepageArticleDate != '' and (j < 1)">
<h2>Artikel</h2>
j++
</xsl:if>
</xsl:for-each>
I've tried using position()
but this won't work since both properties are within $matchedNodes
$matchedNodes consists of umbraco nodes.
Can anyone see a solution for this problem? I've thought about using xsl:template
but im a bit of a newbie at XSLT so I didnt know where to start.