| false() 関数 | |
| 常にブール値 false を返します。XSLT では、文字列 "true" および "false" には特別な意味がありません。この関数および true() 関数を使用すると、必要なときにブール値を直接生成できます。 | |
| 入力 | |
|
なし。 |
|
| 出力 | |
|
ブール値 false。 |
|
| 定義先 | |
|
XPath 4.3 節「Boolean Functions」 |
|
| 例 | |
|
false() 関数を使用する短い例を次に示します。
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:template match="/">
<xsl:value-of select="$newline"/>
<xsl:text>A test of the false() function:</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:choose>
<xsl:when test="false()">
<xsl:text> "false()" returned true!</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> "false()" returned false!</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
XML ドキュメントに対してこのスタイルシートを使用すると、次のような単純な結果になります。 A test of the false() function: "false()" returned false! |
|