[xsl] boolean values

Subject: [xsl] boolean values
From: "Keller, Matt" <Keller.Matt@xxxxxxxxxxxxx>
Date: Wed, 27 Aug 2003 15:35:55 -0500
I'm having trouble creating variables that are equivalent to a boolean value.

I have a variable that was previously coded in this fashion:

<xsl:variable name="hasContracts" select="boolean(/Output/Contracts/Contract)"/>

This returned an actual true/false boolean value, and I was able to test for it like this:

<xsl:if test="$hasContracts"> 

However, due to business needs, I have to expand my variable.  I have since code it in this manner:

   <xsl:variable name="hasContracts">
   		<xsl:choose>
   			<xsl:when test="$branding = 'ABC'"><xsl:value-of select="count(/Output/Contracts/Contract[substring(ContractId,1,1)='Q']) &#62; 0"/>			</xsl:when>
   			<xsl:otherwise><xsl:value-of select="boolean(/Output/Contracts/Contract)"/></xsl:otherwise>  		
   		</xsl:choose>    
   </xsl:variable> 

And now it is no longer a boolean value, perhaps because true or false is a child of the xsl:variable element?

Is there a way to put the value of your variable in a xsl:choose and retain a true boolean value?

Thanks,

Matt

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


Current Thread