xsl-list
[Top] [All Lists]

RE: top level xsl:param confusion

2004-09-30 14:26:32
From: Robert Koberg [mailto:rob(_at_)koberg(_dot_)com]

I have a top level param like so:

<xsl:param name="permission" select="false()"/>


Main Question:

Is the above top level xsl:param considered false even if it was
passed
an empty string? I would expect it to be false only if the param was
*not* passed.
...
For example, the following chooses the otherwise when the param is
sent
to the transformation as an empty string.

<xsl:choose>
   <!--<xsl:when test="boolean($permission)"> or -->
   <xsl:when test="$permission">
<!-- allow access -->
   </xsl:when>
   <xsl:otherwise>
<!-- no access -->
   </xsl:otherwise>
</xsl:choose>


Since an empty string evaluates to "false" in a test, how could you
distinguish between that value and the default value, which was false()?

Cheers,

Tom P


<Prev in Thread] Current Thread [Next in Thread>