S
Si
I'm going round in circles trying to set a value as selected in a
dropdown box on an ASP page.
Basically this is the XML I've got:
<rs:data>
<z:row DirectorateID="67" DirectorateName="CEO"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="68" DirectorateName="eIS"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="69" DirectorateName="S&C"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="70" DirectorateName="F&CR"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="71" DirectorateName="O&S"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="73" DirectorateName="HR"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="74" DirectorateName="SM&C"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="75" DirectorateName="F&CS"
rsName="rc_listDirectorates_sp" />
</rs:data>
-<rs:data>
<z:row AuthorID="11" FullName="Jo West" FirstName="Jo"
LastName="West" DateCreated="2006-12-11" theDirectorateID="74"
rsName="rc_listUsers_sp" />
</rs:data>
The top <rs:data> populating the dropdown box and it's 'selected'
value being determined by the DirectorateID in the next <rs:data>
At the minute I'm think ing of XSLT something like:
<xsl:template match="rs:data[z:row/
@rsName='rc_listDirectorates_sp']">
Directorate:
<select name="Directorates">
<xsl:apply-templates />
</select>
</xsl:template>
<xsl:template match="rs:data/
z:row[@rsName='rc_listDirectorates_sp']">
<xsl:choose>
<xsl:when test="@DirectorateID !=
@DirectorateID">
<option
value="{@DirectorateID}">
<xsl:value-of
select="@DirectorateName"/>
</option>
</xsl:when>
<xsltherwise>
<option selected="selected"
value="{@DirectorateID}">
<xsl:value-of
select="@DirectorateName"/>
</option>
</xsltherwise>
</xsl:choose>
</xsl:template>
but is this any good? Is this even possible?!?
Sorry if this is a stupid question but I'm a DBA by trade.
Thanks
dropdown box on an ASP page.
Basically this is the XML I've got:
<rs:data>
<z:row DirectorateID="67" DirectorateName="CEO"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="68" DirectorateName="eIS"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="69" DirectorateName="S&C"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="70" DirectorateName="F&CR"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="71" DirectorateName="O&S"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="73" DirectorateName="HR"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="74" DirectorateName="SM&C"
rsName="rc_listDirectorates_sp" />
<z:row DirectorateID="75" DirectorateName="F&CS"
rsName="rc_listDirectorates_sp" />
</rs:data>
-<rs:data>
<z:row AuthorID="11" FullName="Jo West" FirstName="Jo"
LastName="West" DateCreated="2006-12-11" theDirectorateID="74"
rsName="rc_listUsers_sp" />
</rs:data>
The top <rs:data> populating the dropdown box and it's 'selected'
value being determined by the DirectorateID in the next <rs:data>
At the minute I'm think ing of XSLT something like:
<xsl:template match="rs:data[z:row/
@rsName='rc_listDirectorates_sp']">
Directorate:
<select name="Directorates">
<xsl:apply-templates />
</select>
</xsl:template>
<xsl:template match="rs:data/
z:row[@rsName='rc_listDirectorates_sp']">
<xsl:choose>
<xsl:when test="@DirectorateID !=
@DirectorateID">
<option
value="{@DirectorateID}">
<xsl:value-of
select="@DirectorateName"/>
</option>
</xsl:when>
<xsltherwise>
<option selected="selected"
value="{@DirectorateID}">
<xsl:value-of
select="@DirectorateName"/>
</option>
</xsltherwise>
</xsl:choose>
</xsl:template>
but is this any good? Is this even possible?!?
Sorry if this is a stupid question but I'm a DBA by trade.
Thanks