This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: newbie variable question
- To: xsl-list at mulberrytech dot com
- Subject: Re: newbie variable question
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Tue, 26 Sep 2000 17:31:12 GMT
- References: <39D0C864.2C19BB6D@lesandchris.com>
- Reply-To: xsl-list at mulberrytech dot com
<xsl:if test="string(type)='DMA'">
<xsl:value-of select="name"/>
<xsl:variable name="ValueExists" select="'True'"/>
</xsl:if> the scope of your variable definition ends here.
...
<xsl:if test="$ValueExists!="'True'"> so its not defined here.
Also xsl has boolean valued variables so you don't need to mess with
faking things with th estring 'True'.
> What I am trying to do is:
> if there are any grp/type element whose contents are "DMA" I want to
> print out the value of the associated name in that grp. if there is no
> grp/type element whose contents is "DMA" I want to print out the values
> of the description element.
<xsl:template match="/">
<xsl:value-of
test="area/grp[type='DMA']/name |
description[not(/area/type='DMA')]" />
</xsl:template>
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list