Altova Mailing List Archives

[xsl] Defining a Variable that depends on an unknown number of conditions

From: "Andrew Ferk" <andrewferk@--------->
Date: 12/31/2008 10:48:00 PM
I am looking for a solution that can define a variable that depends on
an unknown number of conditions.  I'm hoping for a solution
compatibile with XSLT 1.0.

xml file:  in the xml file there can be any number of <option>'s with a value.
  <option value="7"/>
  <option value="8"/>
  <option value="1"/>

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".

The only way I can think of doing this is with <xsl:break />, but that
doesn't exits :)

Thank you.

Andrew Ferk


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 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.