Hi all
I have the following situation:
I am using XSLT to transform the results of a SQL query to list all regions mapped to a certain salesperson. I need to list every region - with a checkbox to indicate if the particular region is actually mapped to that salesperson or not. I've got this far with minimal probs.
Now, what I need to do is, if the checkbox is checked (i.e. the region is mapped), I need to hyperlink the region name to a page displaying all the cities in the region. If it's not checked, I just need to display the name.
I've created an XSLT variable called 'checked' - and what I want to do is assign it a value of true or false based on the value of the checkbox. I know XSLT doesn't really support variables in the same way as a language like VB so is this actually possible? Am I making something very complicated of something that is actually quite simple? Or would I be better off doing this in code?
Here is my XSLT so far (with errors). Any ideas?
<xsl:template match="region">
<tr>
<td><xsl:value-of select="position()"/>.</td>
<td></td>
<td>
<xsl:choose>
<xsl:when test="$UID=userid">
<input type="checkbox" name="CheckMap
{position()}" id="CheckMap{position()}" checked="true" />
<xsl:variable name="checked" select="true" />
</xsl:when>
<xsl
therwise>
<input type="checkbox" name="CheckMap{position()}" id="CheckMap{position()}" />
<xsl:variable name="checked" select="false" />
</xsl
therwise>
</xsl:choose>
</td>
<input type="hidden" id="ACID{position()}" name="ACID{position()}" value="{mapid}" />
<td width="5"></td>
<td><xsl:value-of select="id" /></td>
<input type="hidden" id="txtID{position()}" name="txtID{position()}" value="{id}" />
<td width="5"></td>
<td>
<xsl:choose>
<xsl:when test="$checked='true'">
<a href="./region.aspx?id={id}"><xsl:value-of select="description" /></a>
</xsl:when>
<xsl
therwise>
<xsl:value-of select="description" />
</xsl
therwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
This is just so everyone can see the logic that I'm trying to get at - I know this is wrong ;-)
Thanks as always
Craftor

I have the following situation:
I am using XSLT to transform the results of a SQL query to list all regions mapped to a certain salesperson. I need to list every region - with a checkbox to indicate if the particular region is actually mapped to that salesperson or not. I've got this far with minimal probs.
Now, what I need to do is, if the checkbox is checked (i.e. the region is mapped), I need to hyperlink the region name to a page displaying all the cities in the region. If it's not checked, I just need to display the name.
I've created an XSLT variable called 'checked' - and what I want to do is assign it a value of true or false based on the value of the checkbox. I know XSLT doesn't really support variables in the same way as a language like VB so is this actually possible? Am I making something very complicated of something that is actually quite simple? Or would I be better off doing this in code?
Here is my XSLT so far (with errors). Any ideas?
<xsl:template match="region">
<tr>
<td><xsl:value-of select="position()"/>.</td>
<td></td>
<td>
<xsl:choose>
<xsl:when test="$UID=userid">
<input type="checkbox" name="CheckMap
{position()}" id="CheckMap{position()}" checked="true" />
<xsl:variable name="checked" select="true" />
</xsl:when>
<xsl
<input type="checkbox" name="CheckMap{position()}" id="CheckMap{position()}" />
<xsl:variable name="checked" select="false" />
</xsl
</xsl:choose>
</td>
<input type="hidden" id="ACID{position()}" name="ACID{position()}" value="{mapid}" />
<td width="5"></td>
<td><xsl:value-of select="id" /></td>
<input type="hidden" id="txtID{position()}" name="txtID{position()}" value="{id}" />
<td width="5"></td>
<td>
<xsl:choose>
<xsl:when test="$checked='true'">
<a href="./region.aspx?id={id}"><xsl:value-of select="description" /></a>
</xsl:when>
<xsl
<xsl:value-of select="description" />
</xsl
</xsl:choose>
</td>
</tr>
</xsl:template>
This is just so everyone can see the logic that I'm trying to get at - I know this is wrong ;-)
Thanks as always
Craftor