Having trouble figuring out a simple XSLT loop that counts and returns the name of the actor.
<stars>
<star ID="001">Leonardo DiCaprio</star>
<star ID="002">Matt Damon</star>
<star ID="003">Jack Nicholson</star>
</stars>
This is what I made to give the result I wanted but if there was a fourth or fifth actor I would need to add to the code.
<xsl:value-of select="stars/star[@ID='001']"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="stars/star[@ID='002']"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="stars/star[@ID='003']"/>
Basically I need the loop to display the name of the star separated by a comma. Any help is appreciated.
xsl:for-eachneeds to be used. :)