Subject: Re: [xsl] IF in a variable declaration From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Fri, 17 May 2002 02:29:09 +0200 |
In fact i've got a list of numbers enclosed in <pdf> tags and i want to set the variable "present" with O if the number i search for is present
<xsl:variable name="present">
<xsl:for-each select="/liste/id/compte/pdf">
<xsl:if test="/liste/id/compte/pdf=$ID">O</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$present"/>
The test test="/liste/id/compte/pdf=$ID" will succeed if there is at least one of the pdf elements with a content equal to value of $ID. This seems to be exactly what you ask for. Try:
<xsl:variable name="present"> <xsl:if test="/liste/id/compte/pdf=$ID">O</xsl:if> </xsl:variable>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] IF in a variable declaration, Xavier DAMAY | Thread | [xsl] Adjusting sorted list, Andrew Timberlake |
RE: [xsl] MSXML4 only crashes (Was:, Andrew Kimball | Date | [xsl] On the XPath to my editor...., Mark R. Diggory |
Month |