Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All,
I want to change my logic from if else in Xslt and want to use Switch Statement in Xslt.
Can any one help me in this.
Hussain
Hi there Muhammad
Maybe you can use the choose-statement like this:
<xsl:choose> <xsl:when test="1=2"> Do stuff here </xsl:when> <xsl:when test="$name='Joe'"> Do something else here </xsl:when> <xsl:otherwise> It none of the above when-statements are true, this will be shown </xsl:otherwise></xsl:choose>
Does that solve your problem?
/Kim A
Muhammed,
You could create xslt extension method in c# and do switch statement there but its a bit overkill Kim's suggestion of xsl:choose is better.
Regards
Ismail
Hi Ismail,
I want to do this thing in C# as u have mention above, Can u will guide me who Can i do this.
Hussain,
Take a look at http://umbraco.org/documentation/videos/for-developers/xslt-extensions/introduction-to-xslt-extensions you could also do http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can we use Switch Statement in Xslt
Hi All,
I want to change my logic from if else in Xslt and want to use Switch Statement in Xslt.
Can any one help me in this.
Hussain
Hi there Muhammad
Maybe you can use the choose-statement like this:
Does that solve your problem?
/Kim A
Muhammed,
You could create xslt extension method in c# and do switch statement there but its a bit overkill Kim's suggestion of xsl:choose is better.
Regards
Ismail
Hi Ismail,
I want to do this thing in C# as u have mention above, Can u will guide me who Can i do this.
Hussain
Hussain,
Take a look at http://umbraco.org/documentation/videos/for-developers/xslt-extensions/introduction-to-xslt-extensions you could also do http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions
Regards
Ismail
is working on a reply...