How to select a node that has not attributes but has a specific value in XML

Adar

New Member
I have stored a specific number in a variable ($ResId) from one part of an XML file, and I have the following in a different section.\[code\]<CalculatedWho> <ResourceId>85</ResourceId> <ResourceId>49</ResourceId> <ResourceId>43</ResourceId> <ResourceId>41</ResourceId></CalculatedWho>\[/code\]If any of these match the number stored in the variable, I would then perform a particular task. I've tried the following and several other things, but have yet to get it right.\[code\]<xsl:for-each select="//StrategyPool/Strategy"> <xsl:if test="//StrategyPool/Strategy/CalculatedWho/ResourceId[text()=$ResId]" > <xsl:value-of select="StrategyName"/> </xsl:if></xsl:for-each>\[/code\]The problem is that the IF test never returns a value, though I know there are matches. I've also tried the following as the if test:\[code\] <xsl:if test="/CalculatedWho/ResourceId[text()=$ResId]" >\[/code\]and
 
Back
Top