I have the following XML
<root>
<ns:Search xmlns:ns="http://example.com/1.0/">
<ns:AllClass>
<ns:class1>
<ns:node1>fhgfjh</ns:node1>
<ns:node2>Aprtyrtyril</ns:node2>
<ns:node3>Juklyuiyly</ns:node3>
</ns:class1>
<ns:class2>
<ns:node1>dfgd</ns:node1>
<ns:node2>trytyu</ns:node2>
<ns:node3>sgsdfg</ns:node3>
</ns:class2>
.
.
.
.
.
.
</ns:AllClass>
</ns:Search>
<ns:Req xmlns:ns="http://example.com/1.0/">
<ns:classId>class1</ns:classId>
<ns:othertag>asdfg</ns:othertag>
.
.
.
.
.
</ns:Req>
</root>
and the following XSL
<xsl:template match="root">
<xsl:variable name="class" select="/root/Req/classId" />
<ns1:Request xmlns:ns1="http://example.com/ns1">
<ns1:node>
<xsl:value-of xmlns:ns="http://example.com/1.0/" xmlns:ns1="http://abc.xyz.com/1.0/" select="/root/Search/AllClass[Value=$class]/node1" />
</ns1:node>
</ns1:Request>
</xsl:template>
I am getting a class name inside my XML in 'classId' node. I want to get the value of 'node1' of the class same as my value inside the 'classId' tag. I am using a variable'class' and storing the value of classId and trying to get the value of 'node1' by using the variable inside Select Xpath. But it is not working. Please help.
/root/Search/AllClass/$class/node1/root/Search/AllClass/data($class)/node1