I am trying to make an if statement in my xsl for this xml doc, it only needs to show the value of a content when the typeid = 2:
<xml>
<contents>
<content typeid="1">aaaaa</content>
<content typeid="1">aaaaa</content>
<content typeid="1">aaaaa</content>
<content typeid="2">bbbbb</content>
<content typeid="1">aaaaa</content>
</contents>
</xml>
Code I am tryin to use:
<xsl:for-each select=/xml/contents/content">
<xsl:value-of select="@typeid"/>
<xsl:if test="string=2">
<xsl:value-of select="@typeid"/>
</xsl:if>
</xsl:for-each>
How can I resolve this?
<xml>
<contents>
<content typeid="1">aaaaa</content>
<content typeid="1">aaaaa</content>
<content typeid="1">aaaaa</content>
<content typeid="2">bbbbb</content>
<content typeid="1">aaaaa</content>
</contents>
</xml>
Code I am tryin to use:
<xsl:for-each select=/xml/contents/content">
<xsl:value-of select="@typeid"/>
<xsl:if test="string=2">
<xsl:value-of select="@typeid"/>
</xsl:if>
</xsl:for-each>
How can I resolve this?