iterate through a repeated tag in xml

tom1314

New Member
I have an xml element like this:\[code\]<book> <English color="blue" author="hasan" /> <English color="red" author="david" /></book>\[/code\]Is it possible to iterate through it using xslt and produce the output like the one below ?\[code\]<book> <English color="yellow" author="hally" /> <English color="pink" author="gufoo" /></book>\[/code\]here is the one i am trying; \[code\]<xsl:template match = /book> <xsl:for-each select "./English"> <xsl:if test="@color = '"yellow"'"> <English color="yellow"/> <xsl:if test="@color = '"red"'"> <English color="pink"/> </xsl:for-each> </xsl-template>\[/code\]
 
Back
Top