[xsl] Nesting an xsl:when

Subject: [xsl] Nesting an xsl:when
From: "Iain Emsley" <iainemsley@xxxxxxxxxxxxxx>
Date: Tue, 2 Sep 2008 08:35:51 +0100
Hi,

I'm trying to write an xsl sheet which swaps various buttons if a
different css sheet is loaded for accessibility reasons but I haven't
been able to quite achieve this. The css sheet is changed by choosing
from a drop down menu and that is swapping the site colours but I'm
trying to also swap types of buttons for each sheet depending on what
has css been loaded. I've tried to write an xsl:when test to change
the image url but haven't been successful in changing the button.

<td class="sideBarOpenCloseIcon">
          <xsl:choose>
            <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
              <a href="?setappvar=sidebar(opened)">
               <xsl:choose>
                 <xsl:when test="/bedework/appvar[key='style']/value='yellow'">
                   <img alt="open sidebar"
src="{$resourcesRoot}/resources/sideBarArrowOpenyellow.gif" width="21"
height="16" border="0" align="left"/>
                 </xsl:when>
                 <xsl:when test="/bedework/appvar[key='style']/value='white'">
               <img alt="open sidebar"
src="{$resourcesRoot}/resources/sidebaropenwhitearrow.gif" width="21"
height="16" border="0" align="left"/>
                 </xsl:when>
                 <xsl:otherwise
test="/bedework/appvar[key='style']/value='default'">
               <img alt="open sidebar"
src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21"
height="16" border="0" align="left"/>
                 </xsl:otherwise>
                </xsl:choose>
               </a>
            </xsl:when>
            <xsl:otherwise>
              <a href="?setappvar=sidebar(closed)">
                <img alt="close sidebar"
src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21"
height="16" border="0" align="left"/>
              </a>
            </xsl:otherwise>
          </xsl:choose>
        </td>

I'm trying to get this working before taking on the rest of the
buttons on the site and any guidance would be gratefully received.
Many thanks in advance,

Iain

Current Thread