[xsl] effecient inline multi-conditional testing

Subject: [xsl] effecient inline multi-conditional testing
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Tue, 20 Nov 2001 08:41:31 -0500
Dear <xsl-list:gurus/>,

here's the task:
  -create a template to cast an overloaded boolean value

here's the psuedo-template:
	<xsl:template name="cast:boolean">
		<xsl:param name="b-value">
			<!-- overloaded boolean value;  
				some potential values may be:
					1.  'true' or 'false' or 't' or 'f'
					2.  'yes' or 'no' or 'y' or 'n'
					3.  '1' or '0'
					4.  ...
		<xsl:param name="cast">
			<!-- 'casting' operator;  
				some potential values may be:
					1.  'true-false' or 't-f'
					2.  'yes-no' or 'y-n'
					3.  '1-0'
					4.  ...
		<xsl:if test="$operand">
or($b-value='yes')or($b-value='no') ... )">
						<!-- ... -->

					<xsl:when test="('yes-no'=$cast)">
						<!-- ... -->

						<!-- ... -->


my question is this:
Any ideas on a more effecient way to conduct the second (xsl:if) test than
the way I'm about to?

Maybe some stylesheet scoped param that acts like a mask and then use the
translate(...) function?  Or, ...?

If there is a FAQ on this, then I apologize ... I looked and couldn't find


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread