vendredi 27 novembre 2015

Xsl if statement inside xsl for each statement: how?

i have an xml:

<newsletter country="nl">
<shop id="1">
<primaryOffer type="hunt">

Now i have an xslt:

<xsl:for-each select="//shop[@id='1']">
< do A>
</xsl:for-each>

now i am looking for an if statement, inside the xsl for each statement, which says: if primaryOffer type="hunt" do A, else do B

How do i do this?

I tried

<xsl:for-each select="//shop[@id='1']">
<xsl:if select="//primaryOffer[@type='hunt']">A</xsl:if>
B
</xsl:for-each>

Here is the xml: http://ift.tt/1XwPJX0

Thanks!

Aucun commentaire:

Enregistrer un commentaire