![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - RE: get count of attributes with certain value dynamically get count of attributes with certain value dynamicallyTo: NULL Date: 7/12/2007 1:37:00 PM
Right now, a co-worker is using the following code to determine the
value for a colspan attribute in some html.
xsl:if test="(//element1[@attribute1='yes']) or (//
element1[@attribute2='yes']) or (//element1[@attribute3='yes'])">
<td align="center">
<xsl:attribute name="colspan">
<xsl:choose>
<xsl:when test="(//element1[@attribute1='yes']) and (//
element1[@attribute2='yes']) and (//element1[@attribute3='yes'])">3</
xsl:when>
<xsl:when test=" ((//element1[@attribute1='yes']) and (//
element1[@attribute2='yes'])) or ((//element1[@attribute2='yes']) and
(//element1[@attribute3='yes']) ) or ((//element1[@attribute1='yes'])
and (//element1[@attribute3='yes']) )">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:attribute>Display text goes
here.
</td>
</xsl:if>
However, this becomes very cumbersome very quickly if attribute4 would
have to be added and checked. Is there an easy way to pass a list
attributes to some kind of dynamic template that could count them up
and return that value?
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
