[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Checking a literal
Subject: Re: Checking a literal
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 02 Jul 2002 16:17:28 +0200
|
It checks the string of 'workgroups/workgroup/name'. Your problem is a
different one I think. You have to place the value to check for (which
should be a string I assume) in quotes like "ChiCS-Operator" and so on.
Otherwise 'workgroups/workgroup/queue/ChiCS-Operator' (=> as element) will
be evaluated.
Regards,
Joerg
PattiJo.Seglin@xxxxxxxxxx wrote:
I'm a definite novice at XSL. I am learning it at work while I'm working with
it and I have a question about checking a literal in a 'when' statement.
The code is as follows:
*********************************************************************************
<xsl:for-each select="workgroups/workgroup/queue">
<tr>
<xsl:choose>
<xsl:when test="string(../name)=ChiCS-Operator">
<td align="left"><font class="f3">Operator</font>
</td>
</xsl:when>
<xsl:when test="string(../name)=ChiCS-RegionCentral">
<td align="left"><font class="f3">Central</font>
</td>
</xsl:when>
<xsl:when test="string(../name)=ChiCS-RegionEast">
<td align="left"><font class="f3">East</font>
</td>
</xsl:when>
<xsl:when test="string(../name)=ChiCS-RegionWest">
<td align="left"><font class="f3">West</font>
</td>
</xsl:when>
<xsl:otherwise>
<td align="left"><font class="f3">Default</font>
</td>
</xsl:otherwise>
</xsl:choose>
etc...
*********************************************************************************
I tried to write the above just looking at code that was already there, this
is an application we received from a third party. What I'm trying to do is
check the workgroup and if it equals 'something' then put something else in
it's place on the screen, to cut down on the length of the name and save
space. I'm assuming (uh-oh) that 'workgroups/workgroup/queue/name' is where I
want to look as that 'for-each select' stmt was already there and they were
using ../name to put the literal from wherever this is, on the screen.
However, all that happens with the above code is that 'Default' gets put on
the screen three times. What am I doing wrong?
Thanks.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
System Development
VIRBUS AG
Fon +49(0)341-979-7419
Fax +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|