I have some XSLT that looks like:
<xsl:choose>
<xsl:when test="string(//User[@UserID = $UserID]/ROOT/Prop[@Nm = 'GreaseBoardCategory'])">
<xsl:variable name="Type" select="concat('Documenter', //User[@UserID = $UserID]/ROOT/Prop[@Nm = 'GreaseBoardCategory'])"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="Type" select="concat('Documenter', user:GetUserType(string(//Payload/@SiteID), string(@UserID)))"/>
</xsl:otherwise>
</xsl:choose>
And I want to assign a variable to it called "Type" I see from other examples that I should be doing this instead:
<xsl:variable name="Type">
<xsl:choose>
<xsl:when test="string(//User[@UserID = $UserID]/ROOT/Prop[@Nm = 'GreaseBoardCategory'])">
<xsl:value-of select="concat('Documenter', //User[@UserID = $UserID]/ROOT/Prop[@Nm = 'GreaseBoardCategory'])"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('Documenter', user:GetUserType(string(//Payload/@SiteID), string(@UserID)))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
But my variable is NOT getting set. It should hit the Otherwise block but never does. Any ideas? It doesn't get set to anything..
The only way to get Type to be set is to do away with the Choose/When/Otherwise statements and just pick one of the two options, like:
<xsl:variable name="Type" select="concat('Documenter', //User[@UserID = $UserID]/ROOT/Prop[@Nm = 'GreaseBoardCategory'])"/>
for example.