Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-21-2012, 02:36 AM   PM User | #1
michaeljeffrey
New to the CF scene

 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
michaeljeffrey is an unknown quantity at this point
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-



Code:
    <!-- 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>
michaeljeffrey is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:18 AM.


Advertisement
Log in to turn off these ads.