This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: using <xsl:if> inside the select menu
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: using <xsl:if> inside the select menu
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Tue, 1 Aug 2000 01:16:45 +0100
- Reply-To: xsl-list at mulberrytech dot com
Try
<option value="K">
<xsl:if test="$G ='K'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
K</option>
No quotes on $G
>Please help me to set up code that will work. I am trying to set up
>selected item in the select menu from the XML.
>Without <xsl:if> it works, but otherwise not.
>
><xsl:variable name='G' select='1'/>
> <xsl:value-of select='$G' />
>
> <select name = "res_level" >
> <option value="K">
> <xsl:if test="'$G' ='K'">
> <xsl:attribute name="selected">selected</xsl:attribute>
> </xsl:if>
> K</option>
> <option vaule="1">
> <xsl:if test="'$G' ='1'">
> <xsl:attribute
>name="selected">selected</xsl:attribute>
> </xsl:if>
> 1</option>
> <option value="2">
> <xsl:if test="'$G' ='2'">
> <xsl:attribute name="selected">selected</xsl:attribute>
> </xsl:if>
> 2</option>
></select>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list