Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to assign a variable a boolean value

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
US
Whenever I try to assign a variable a boolean value, the boolean is converted to a string value of 'true' or 'false'.

For example:
<xsl:variable name="IsPackage" select="substring(normalize-space(/Policy/PolicyNo),1,2)='WK'" />

After some testing I discovered that $IsPackage is actually a string, not a boolean. Is it possible to create a variable that is truly a boolean data type?
 
Never mind. I figured it out.

My example above actually works correctly. What wasn't working was the following:

<xsl:variable name="IsPackage">
<xsl:value-of select="substring(normalize-space(/Policy/PolicyNo),1,2)='WK'" />
</xsl:variable>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top