Comparing Variables

Here should go questions about transforming XML with XSLT and FOP.
mchowdhury
Posts: 1
Joined: Tue Apr 01, 2014 8:13 pm

Comparing Variables

Post 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>
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Comparing Variables

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jamil
Posts: 99
Joined: Thu Oct 23, 2008 6:29 am

Re: Comparing Variables

Post 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.
Post Reply