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



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

Here is what the spec has to say about it:
http://w3.org/TR/xslt#variable-values
If the variable element has a select attribute, the value of the
variable is the  object resulting from the evaluation of the expressio
in that attribute.
If the variable element has child nodes, the value of the variable is a
result tree fragment.

W.

Werner, Wolfgang wrote:

| 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
|
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
xslt gnome org
http://mail.gnome.org/mailman/listinfo/xslt

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

iD8DBQFBg4EzqjaicDyx8o8RAmRJAKCEZlIvinUTD0ff2umh0T+sX5h8JQCeMmTX
fC1tBreg38Vcr/BDhNmXuD4=
=50sZ
-----END PGP SIGNATURE-----


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