I'm trying to go through a set of nodes thanks to a for-each, and I'd like to select the current node in a variable when the parameters in this node validate few conditions. The problem is that it seems to select the value in the node, and not the actual node itself. And I'd like to be able to use this variable as a nodeset later.
XML ($parameterFile) :
<?xml version="1.0" encoding="UTF-8"?>
<Cases>
<Case>
<Rule LineNumber="10" PartNumber="FT40X40"/>
<Template>
<Drawings>
test
</Drawings>
</Template>
</Case>
<Case>
<Rule LineNumber="10" PartNumber="FT40X46k"/>
<Template>
<Drawings>
test2
</Drawings>
</Template>
</Case>
XSLT :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="xs"
version="2.0">
<xsl:variable name="GoodCase">
<xsl:for-each select="$parameterFile/Cases/Case">
<xsl:choose>
<xsl:when test="(Rule/@LineNumber = $markerNbLines) and
(Rule/@PartNumber = $markerPartNumber)">
<xsl:value-of select="current()"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="$parameterFile/$GoodCase/Template/Drawings">
test
</xsl:for-each>
Output expected :
test
Thanks !