This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:when evaluated not=""
- To: xsl-list at mulberrytech dot com
- Subject: Re: xsl:when evaluated not=""
- From: robin at kitsite dot com
- Date: Fri, 8 Sep 2000 14:43:19 +0100
- References: <DBF5834E2987D311A4BE0060081D992C2C3EC1@BUR2>
- Reply-To: xsl-list at mulberrytech dot com
Untested code follows:
<xsl:variable name="directory">
<xsl:eval>getDirectory(this.getAttribute('page'))</xsl:eval>
</xsl:variable>
<xsl:choose>
<xsl:when test="$directory">
<A href="{$directory}" target="new_window">
<xsl:value-of select="@text"/>
</A>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@text"/>
</xsl:otherwise>
</xsl:choose>
hth/
.robin.
On Fri, Sep 08, 2000 at 06:45:27AM -0500, Eric Taylor wrote:
> Part of my XSL looks like this:
>
> <xsl:choose>
> <xsl:when *** stuck here ***>
> <A>
> <xsl:attribute
> name="href"><xsl:eval>getDirectory(this.getAttribute('page'))</xsl:eval></xs
> l:attribute>
> <xsl:attribute name="target">new_window</xsl:attribute>
> <xsl:value-of select="@text"/>
> </A>
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of select="@text"/>
> </xsl:otherwise>
> </xsl:choose>
>
> I only want the "when" to happen if
> <xsl:eval>getDirectory(this.getAttribute('page'))</xsl:eval> returns some
> value (that is, if it returns a blank value, I want to do the "otherwise").
> I don't know the syntax for this. Thanks. Eric
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
"Do nine men interpret?" "Nine men," I nod.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list