Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: xsl syntax / logic
04-21-2012, 03:36 AM #1
- Join Date
- Apr 2012
- Thanked 0 Times in 0 Posts
xsl syntax / logic
I am having a terrible time with XSL synax. I can't seem to figure out how to set a global variable before you enter the loop and then run the loop and then test the variable.
For example, I am trying to have the name of the a certain element displayed once in loop. I wrote some psuedo-code in there to help with the logic-
<!-- set variable here --> <xsl:template match="PLAY"> <xsl:variable name="unique-list" /> <xsl:for-each select="ACT/SCENE/SPEECH"> <xsl:if test="contains(SPEAKER,'KING HENRY V')"> <xsl:variable name="check-list"/> <xsl:value-of select="../../TITLE" /> <xsl:if test="if ($unique-list != $check-list)> <h3><xsl:value-of select="../../TITLE" /></h3> <xsl: $check-list = value-of select="../../TITLE"/> </xsl:if> </xsl:if> </xsl:for-each> </xsl:template>