xsl-list
[Top] [All Lists]

[xsl] Nesting an xsl:when

2008-09-02 03:36:23
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>