Subject: Re: [xsl] Variable: true or false From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 06 Apr 2001 16:52:09 +0100 |
<xsl:variable name="selectUser"> <holla/> </xsl:variable>
<xsl:variable name="selectUser" select="''"/> (setting the value to be the empty string), or
<xsl:variable name="selectUser" select="false()"/> (a boolean false), or even
<xsl:variable name="selectUser" select=""/> (the null expression evaluates to an empty node set),
Cheers, Wendell
I do the transform on this XSL and get "true". I would have expected "false". Thought the boolean of an empty object would always be false.
Using Xerces 1.4 and Xalan 1.1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:variable name="selectUser"/> <xsl:template match="/"> <xsl:choose> <xsl:when test="$selectUser"> true </xsl:when> <xsl:otherwise> false </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
Tom Gilbert tom.gilbert@xxxxxxxxxxxxx
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Variable: true or false, Tom Gilbert | Thread | Re: [xsl] Variable: true or false, Jeni Tennison |
AW: [xsl] including javascript??, Marcus Klinge | Date | RE: [xsl] grouping content - going , Gavin Myers |
Month |