Hi Gowri,
Please find the corrected code here.
----------------------------
<h2>Electrical characteristics Process = <xsl:variable name="strength"
select="macro/CV/electrical/PTV/strength"/>
<xsl:choose>
<xsl:when test="$strength = 'W'">
Weak
</xsl:when>
<xsl:when test="$strength = 'N'">
Nominal
</xsl:when>
<xsl:otherwise>
Strong
</xsl:otherwise>
</xsl:choose>
</h2>
--------------
Good luck,
Sreeni
-----Original Message-----
From: Gowri Ratakonda [mailto:gratakonda(_at_)yahoo(_dot_)com]
Sent: Thursday, March 16, 2006 11:55 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Conditional test is failing
I am using <xsl:choose> to replace these values in the XML file:
W, N, S
with these in the output HTML:
Weak, Nominal, Strong
Need help to figure out why my conditional statement is picking the last
value in the <xsl:choose> block all the time.
My XMl file looks like this:
<macro>
<macro_name>NRTCLDFFBQ_F1_SNPM</macro_name>
<library>GS60</library>
<CV>
<Vdd>1.35</Vdd>
<size>9.875</size>
<electrical>
<slew>
<value>2</value>
<units>PS</units>
</slew>
<PTV>
<strength>N</strength>
<voltage>1.35</voltage>
<temp>25</temp>
</PTV>
.
.
.
</electrical>
</CV>
</macro>
-------------------------------------------------
Here is my code for the <xsl:choose> element:
<h2>Electrical characteristics Process = <xsl:variable name="strength"
select="macro/CV/electrical/PTV/strength"/>
<xsl:choose>
<xsl:when test='$strength = W'>
Weak
</xsl:when>
<xsl:when test='$strength = N'>
Nominal
</xsl:when>
<xsl:otherwise>
Strong
</xsl:otherwise>
</xsl:choose>
</h2>
----------------------------------------------------
Instead of 'Nominal', I get 'Strong' in my output file.
Could someone please tell me what's wrong with my code?
Thanks,
Gowri
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--