Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] Defining a Variable that depends on an unknown number of conditions [Thread Next] RE: [xsl] Defining a Variable that depends on an unknown number of conditionsTo: Date: 1/1/2009 10:30:00 AM > xsl file: How do I define variable "hasZero" based on these
> conditions...
> a) if at least one option has value="0", set "hasZero" to "yes"
> b) otherwise "hasZero" is "no".
>
<xsl:variable name="hasZero">
<xsl:choose>
<xsl:when test="option[@value='0']">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Michael Kay
http://www.saxonica.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
