If think it would be great if you could keep your XSLT related questions in the same post so that all the information is possible to find in the same post and others can benefit from reading the entire post instead of finding snippets when they search - I've provided an answer to your initial questio in here: http://our.umbraco.org/forum/developers/xslt/36014-xslt-doubts?p=0#comment130584
The above example looks like a snippet from a paging snippet, where the value of the "page" querystring is being tested. If the qyerstring has a value of 1, is empty or is not a number the value "1" is written out. The querystring is what is added to the "main" url so if you have a url like this: http://mysite.com?page=1 - 1 is returned. If it's http://mysite.com?page=2 - 2 is returned and so on.
You can declare a variable like <xsl:variable name="myvariable" select="umbraco.library:RequestQueryString('page')" /> or you can make the variable contain a conditional value by writing this
xslt when usage
Hi,
pls explain me below, how it works , what value it retrive
how we declare variable in xslt?
pls explain me below code
<xsl:when test="number(umbraco.library:RequestQueryString('page')) <=1
or string(umbraco.library:RequestQueryString('page')) = ''
or string(number(umbraco.library:RequestQueryString('page'))) = 'NaN'">
<xsl:value-of select="1"/>
</xsl:when>
Hi Kannadesikan
If think it would be great if you could keep your XSLT related questions in the same post so that all the information is possible to find in the same post and others can benefit from reading the entire post instead of finding snippets when they search - I've provided an answer to your initial questio in here: http://our.umbraco.org/forum/developers/xslt/36014-xslt-doubts?p=0#comment130584
The above example looks like a snippet from a paging snippet, where the value of the "page" querystring is being tested. If the qyerstring has a value of 1, is empty or is not a number the value "1" is written out. The querystring is what is added to the "main" url so if you have a url like this: http://mysite.com?page=1 - 1 is returned. If it's http://mysite.com?page=2 - 2 is returned and so on.
You can declare a variable like <xsl:variable name="myvariable" select="umbraco.library:RequestQueryString('page')" /> or you can make the variable contain a conditional value by writing this
<xsl:variable name="myvariable">
<xsl:choose>
<xsl:when test="umbraco.library:RequestQueryString('page') = ''">1</xsl:when>
<xsl:when test="umbraco.library:RequestQueryString('page') = ''ABC">1</xsl:when>
</xsl:choose>
</xsl:variable>
The second example is not the best but it should be enough to get the ghist of it I believe :)
/Jan
is working on a reply...