OK, I would expect this code below to fill in the dropdown list with the enumerated values from the xml schema, and then select the Female element as the currently selected value in the list control.
What actually happens is that all the values go into the list control, but it does not select the default value. (neither into the textbox at the top to show it is selected, or by highlighting the choice when you expand the list.)
Can anyone spot the (not so)deliberate mistake?
k
What actually happens is that all the values go into the list control, but it does not select the default value. (neither into the textbox at the top to show it is selected, or by highlighting the choice when you expand the list.)
Can anyone spot the (not so)deliberate mistake?
Code:
<select name = "ddlGender" id="ddlGender">
<xsl:for-each select="document('[URL unfurl="true"]http://localhost/xmlproject/bdefinitions.xsd')/xs:schema/xs:simpleType[/URL][@name='gendertype']//xs:enumeration">
<option value="{@value}">
<xsl:if test="@value='Female'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@value"/>
</option>
</xsl:for-each>
k