Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


get count of attributes with certain value dynamically

From: Bryan Ax <bax@------------.--->
To: 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?



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent