Page 1 of 1

Comparing Variables

Posted: Tue Apr 01, 2014 8:30 pm
by mchowdhury
I am trying to compare xsl variable but its not printing anything out.

Code: Select all


<tr>
<td class="gpl">Applied</td>
<td class="gl">
<xsl:variable name="vGRAD" select="/Rpt/Dg/Cust[@Code='GRADMJ']"/>
<xsl:variable name="vMAJ" select="/Rpt/Fop/Gl[@Code='MAJ']"/>
<xsl:choose>
<xsl:when test="$vGRAD = $vMAJ">YES</xsl:when>
<xsl:when test="$vGRAD != $vMAJ">NO</xsl:when>
</xsl:choose>

</td>
</tr>

Re: Comparing Variables

Posted: Wed Apr 02, 2014 11:28 am
by adrian
Hi,

The XSL seems fine, but it depends on what you have in the XML source. Check for namespaces, it's a common problem.

Regards,
Adrian

Re: Comparing Variables

Posted: Thu Apr 03, 2014 3:31 pm
by Jamil
mchowdhury wrote:I am trying to compare xsl variable but its not printing anything out.
There really is not enough information to identify the issue. Try adding a sample of your XML document to this thread. A small mock-up will do fine.