I want to test if the name of the attribute contains 'description'
(doesn't matter whether it is description1, 2 or 3, as long as the name has description in it) and then use this in for-each cycle. If not, I don't want to show the element. So I have an XML structure like the following:
<item>
<name>Test xslt</name>
<code>XSLT</code>
<description>
<description1>1x stay</description1>
<description2>1x breakfast</description2>
<description3>1x diner</description3>
<description4>1x free late check-out</description1>
<address>New York 1234AZ</address>
</description>
</item>
And then my XSLT would be:
<xsl:for-each select="description">
<xsl:if test=""> (test here if name cointains description)
<p><xsl:value-of select="." /></p>
</xsl:if>
</xsl:for-each>
Now it also shows the element in the array. Does anyone know how to test if the name of element contains specific text and then only show these? Thanks in advance!
Edit:
Fixed the edit already.