xsl-list
[Top] [All Lists]

RE: [xsl] Variable value change based on condition

2010-10-05 09:38:35
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..

I am making this simple. 

Condition 1: 

<?xml version="1.0" encoding="UTF-8"?>
<InputXml>      
        <InputXmlValue1>aaaaa12345</InputXmlValue1>
        <InputXmlValue2>bbb567890</InputXmlValue2>
        <InputXmlValue3>ccc12345</InputXmlValue3>
</InputXml>


<?xml version="1.0" encoding="UTF-8"?>
<OutputXml>     
        <outputTempVar1>aaaaa12345</outputTempVar1>
        <outputVar1>bbb567890</outputVar1>
        <outputVar2>ccc12345</outputVar2>
</OutputXml>


Condition 2: 

<?xml version="1.0" encoding="UTF-8"?>
<InputXml>      
        <InputXmlValue1>aaaaa12345</InputXmlValue1>
        <InputXmlValue2>bbb567890</InputXmlValue2>
        <InputXmlValue3></InputXmlValue3>
</InputXml>


<?xml version="1.0" encoding="UTF-8"?>
<OutputXml>     
        <outputTempVar1></outputTempVar1>
        <outputVar1>aaaaa12345</outputVar1>
        <outputVar2>bbb567890</outputVar2>
</OutputXml>


Condition 3: 

<?xml version="1.0" encoding="UTF-8"?>
<InputXml>      
        <InputXmlValue1>aaaaa12345</InputXmlValue1>
        <InputXmlValue2></InputXmlValue2>
        <InputXmlValue3></InputXmlValue3>
</InputXml>


<?xml version="1.0" encoding="UTF-8"?>
<InputXml>      
        <outputTempVar1></outputTempVar1>
        <outputVar1>aaaaa12345</outputVar1>
        <outputVar2></outputVar2>
</InputXml>



--- On Tue, 10/5/10, Kerry, Richard 
<richard(_dot_)kerry(_at_)siemens(_dot_)com> wrote:

From: Kerry, Richard <richard(_dot_)kerry(_at_)siemens(_dot_)com>
Subject: RE: [xsl] Variable value change based on condition
To: "xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com" 
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Date: Tuesday, October 5, 2010, 10:15 AM

"Requirements" means we'd like to know :

1.
What the input xml looks like (a short example, perhaps).

2.
What the output xml looks like (a short example, perhaps).

3.
An explanation of logical releationships between the data
in the input and the data in the output.
Especially if it isn't obvious.
Actually even if you think it is obvious, as it may not be
to us.



Appreciatively,
Richard.



-----Original Message-----
From: Mukul Gandhi [mailto:gandhi(_dot_)mukul(_at_)gmail(_dot_)com]

Sent: 05 October 2010 15:11
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Variable value change based on
condition

Hi Sudheshna,

On Tue, Oct 5, 2010 at 7:25 PM, sudheshna iyer 
<sudheshnaiyer(_at_)yahoo(_dot_)com>
wrote:
I have java program which I have to convert to
xslt.

That looks a strange requirement. Why would you want
to do that? Java
is an procedural (and OO) language -- and is general
purpose, where
XSLT is functional / side-effect free language
designed to transform
XML / text input to say XML, text & XHTML formats
(which are well
known output targets of XSLT transformation).

We could also imagine, that there is tremendous
impedance mismatch
between Java & XSLT. I personally don't see any
point of mapping Java
syntax to XSLT syntax. Given application design
normally uses Java and
XSLT in complementation.

Though Java has APIs (like an older TraX and I think
most recent ones
like JAXP) to invoke XSLT transformation.

If you would like to explain the requirements little
more to us, list
members here would be very pleased to help :)



-- 
Regards,
Mukul Gandhi


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




      

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