View Single Post
Old 08-05-2009, 11:26 AM   PM User | #6
RossMcCaughrain
New Coder

 
Join Date: Jul 2009
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
RossMcCaughrain is an unknown quantity at this point
Lol. Yeah that one has caught me out before as well!

Now to select your option i use

Code:
<?xml version="1.0">
<root>
    <options>
        <option>
            <value>Value 1</value
            <name>Name</name>
        </option>
        .....
    </options>
</root>
Code:
<xsl:for-each select="//options">
    <xsl:choose>
        <xsl:when test="./option/value = $selectedOption">
            <option value="{./option/value}" selected="selected">
                <xsl:value-of select="./option/name" />
            </option>
        </xsl:when>
	<xsl:otherwise>
		<option value="{./option/value}">
                    <xsl:value-of select="./option/name" />
                </option>
	</xsl:otherwise>
    </xsl:choose>
</xsl:for-each>

Anyway glad you got it sorted!
RossMcCaughrain is offline   Reply With Quote