![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - assigning an elements content to variable and then testing >Thread Next - Re: assigning an elements content to variable and then testing Re: assigning an elements content to variable and then testingTo: NULL Date: 2/2/2005 7:19:00 PM Tempore 20:15:14, die Wednesday 02 February 2005 AD, hinc in foro {comp.text.xml} scripsit Ian Rutgers <ian.rutgers@g...>:
> <tr>
> <td class="autoDescr">Towing</td>
> <td><xsl:variable name="towingCapable" select=".//towing/text()"
> />
> <xsl:choose>
> <xsl:when test="$towingCapable=true">
> <xsl:text>Available</xsl:text>
> </xsl:when>
> <xsl:otherwise> <xsl:text>Not Available</xsl:text>
> </xsl:otherwise>
> </xsl:choose></td>
> </tr>
Hi,
Try quoting the string value to which the variable must be tested.
<xsl:when test="$towingCapable='true'">.
otherwise, your checking if there exists a 'true' child element with a string value equal to the variable.
It could also be that whitespaces are spoiling the test. In that case, declae your variable thus:
<xsl:variable name="towingCapable" select="normalize-space(.//towing/text())"/>
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Vincit omnia simplicitas
Keep it simple
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
