xsl-list
[Top] [All Lists]

Re: [xsl] Variable value change based on condition

2010-10-05 10:18:58
Thank you all. Let me try this. 



--- On Tue, 10/5/10, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

From: David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>
Subject: Re: [xsl] Variable value change based on condition
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Cc: "sudheshna iyer" <sudheshnaiyer(_at_)yahoo(_dot_)com>
Date: Tuesday, October 5, 2010, 10:51 AM
On 05/10/2010 15:38, sudheshna iyer
wrote:
Team, thank you for your patience. I complete
understand that converting java code to xslt doesn't make
much sense. But tech change required this, which I don't
have control on. Since I came from java background, it is
becoming harder for me..

so there were no variables at all, you meant "elements" I
doubt anyone would have guessed that.


<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="InputXml">
<OutputXml>    
<xsl:choose>
<xsl:when test="InputXmlValue3='' and
InputXmlValue2=''">
   
<outputTempVar1></outputTempVar1>
    <outputVar1><xsl:value-of
select="InputXmlValue1"/></outputVar1>
    <outputVar2></outputVar2>
</xsl:when>
<xsl:when test="InputXmlValue3=''">
   
<outputTempVar1></outputTempVar1>
    <outputVar1><xsl:value-of
select="InputXmlValue1"/></outputVar1>
    <outputVar2><xsl:value-of
select="InputXmlValue2"/></outputVar2>
</xsl:when>
<xsl:otherwise>
    <outputTempVar1><xsl:value-of
select="InputXmlValue1"/></outputTempVar1>
    <outputVar1><xsl:value-of
select="InputXmlValue2"/></outputVar1>
    <outputVar2><xsl:value-of
select="InputXmlValue3"/></outputVar2>
</xsl:otherwise>
</xsl:choose>
</OutputXml>
</xsl:template>
</xsl:stylesheet>


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered
in England
and Wales with company number 1249803. The registered
office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United
Kingdom.

This e-mail has been scanned for all viruses by Star. The
service is
powered by MessageLabs.
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--