Subject: Re: newbie variable question From: "John E. Simpson" <simpson@xxxxxxxxxxx> Date: Tue, 26 Sep 2000 14:14:53 -0400 |
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. [XML:] <area> <grp> <type>MSA</type> <name>foo</type> </grp> <grp> <type>DMA</type> <name>bar</type> </grp> </area> <description>baz</description>
[XSLT:] <xsl:for-each select="area/grp"> <xsl:if test="string(type)='DMA'"> <xsl:value-of select="name"/> <xsl:variable name="ValueExists" select="'True'"/> </xsl:if> </xsl:for-each> <xsl:if test="$ValueExists!="'True'"> <xsl:value-of select="description" /> </xsl:if>
but I keep getting an error:
A reference to variable or parameter 'ValueExists' cannot be resolved. The variable or parameter may not be defined, or it may not be in scope.
Begin for-each.... If some condition.... Define variable $ValueExists End if End for-each
If some condition.... Do something with $ValueExists End if
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: newbie variable question, David Carlisle | Thread | RE: newbie variable question, Don Bruey |
[no subject], Josh Zeidner | Date | How to search for <, >, etc. in a s, Brian Young |
Month |