Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Assigning value to variable based on xsl:choose test (http://www.velocityreviews.com/forums/t729964-assigning-value-to-variable-based-on-xsl-choose-test.html)

michael75 08-03-2010 04:45 PM

Assigning value to variable based on xsl:choose test
 
Hello,

can somebody tell me why this code does not work?

Code:

<xsl:variable name="pagesvar">
    <xsl:choose>
        <xsl:when test="/p/divi/text() = 'bla'">
            <xsl:value-of select="/p/navigation/page//page[template='T1']"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="/p/navigation/page//page[template='T2']"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:variable>

I know that following code works, but in the future I will have more test cases, so its just a temporary solution.
Code:

<xsl:variable name="pagesvar" select="if (/p/divi/text()='bla') then /p/navigation/page//page[template='T1'] else /p/navigation/page//page[template='T2']"/>
thanks,
michael


All times are GMT. The time now is 11:10 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.