Re: [xslt] Creating variable with "false()" value



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

i just fiddled around a bit, but didn't find a solution.
What strikes me as odd is that
	<xsl:variable name='v' select='false()'/>
works, while
	<xsl:variable name='v'>
		<xsl:value-of select='false()'/>
	</>
does not.
I don't think it's a bug as xsltproc, xmlspy, msxml and saxon 6 & 8 all
return the result you described.

I don't know if this was helpful.

Regards,
Wolfgang





Petr Novak wrote:
| Hallo,
| my question is about creating of the variable with the false() value.
I need
| create the variable by the follow way:
|
| <xsl:variable name="myVariable">
| 	<xsl:choose>
| 		<xsl:when test="someMyTest">
| 			<xsl:value-of select="true()"/>
| 		</xsl:when>
| 		<xsl:otherwise>
| 			<xsl:value-of select="false()"/>
| 		</xsl:otherwise>
| 	</xsl:choose>
| </xsl:variable>
|
|
| But the variable $myVariable is ever true(). So I tested:
|
| <xsl:variable name="myVariable">
| 	<xsl:if test="false()"/>
| </xsl:variable>
|
| This code generates nothing, but the variable $myVariable is still
ever true().
| Why? Only way how to create the variable with the false() value is:
|
| <xsl:variable name="myVariable">
| </xsl:variable>
|
| Is is some feature?
|
| I'm using libsxlt-1.1.10
|
|
| 	Thanks
|
| -petrn

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBg3s7qjaicDyx8o8RAgrXAJ9C8No11gAtxiLsR3yNp4TbvH4BcQCeJvI8
/i6YE/Flni6rGXgSPIl3VqM=
=p48M
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]