XSL transformer

Amila Liyanaarachchi <[email protected]> Tue, 5 Aug 2008 17:09:00 +0530
Newsgroups gmane.text.xml.xpath.general
Message-ID <88CCC2A657757A4EBDB4B19CAD978E5927582F2220@CMBEXMBX1.corpnet.ifsworld.com>
--_000_88CCC2A657757A4EBDB4B19CAD978E5927582F2220CMBEXMBX1corp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

I need to perform the following transformation, any help will be appreciate=
d,


-------- input xml -------------
<soapenv:Envelope xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope=
/" xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" xmlns:xsi=3D"http://www.w=
3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:driveTimeDisResponse soapenv:encodingStyle=3D"http://schemas.xml=
soap.org/soap/encoding/" xmlns:ns1=3D"http://routing.soap.geosolutions.be">
         <driveTimeDisReturn href=3D"#id0"/>
      </ns1:driveTimeDisResponse>
      <multiRef id=3D"id0" soapenc:root=3D"0" soapenv:encodingStyle=3D"http=
://schemas.xmlsoap.org/soap/encoding/" xsi:type=3D"ns2:SoapReturnDriveTime"=
 xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2=3D"h=
ttp://beans.soap.geosolutions.be">
         <errorCode xsi:type=3D"soapenc:string"/>
         <errorMessage xsi:type=3D"soapenc:string"/>
         <routesInfo soapenc:arrayType=3D"ns2:GenRouteInfo[1]" xsi:type=3D"=
soapenc:Array">
            <routesInfo href=3D"#id1"/>
         </routesInfo>
         <token xsi:type=3D"soapenc:string">XXX</token>
      </multiRef>
      <multiRef id=3D"id1" soapenc:root=3D"0" soapenv:encodingStyle=3D"http=
://schemas.xmlsoap.org/soap/encoding/" xsi:type=3D"ns3:GenRouteInfo" xmlns:=
ns3=3D"http://beans.soap.geosolutions.be" xmlns:soapenc=3D"http://schemas.x=
mlsoap.org/soap/encoding/">
         <distance href=3D"#id2"/>
         <time href=3D"#id3"/>
      </multiRef>
      <multiRef id=3D"id2" soapenc:root=3D"0" soapenv:encodingStyle=3D"http=
://schemas.xmlsoap.org/soap/encoding/" xsi:type=3D"xsd:long" xmlns:soapenc=
=3D"http://schemas.xmlsoap.org/soap/encoding/">73770</multiRef>
      <multiRef id=3D"id3" soapenc:root=3D"0" soapenv:encodingStyle=3D"http=
://schemas.xmlsoap.org/soap/encoding/" xsi:type=3D"xsd:long" xmlns:soapenc=
=3D"http://schemas.xmlsoap.org/soap/encoding/">2884</multiRef>
   </soapenv:Body>
</soapenv:Envelope>
-------------------------------------

--- expected output ----
<AAA>
<distance>73770</distance>
<time>2884</time>
</AAA>
---------------------------------

-------------------------------------------------------------------------=
-----

CONFIDENTIALITY AND DISCLAIMER NOTICE

This e-mail, including any attachments, is confidential and intended only=
 for
the addressee. If you are not the intended recipient, please notify us
immediately and delete this e-mail from your system. Any use or disclosur=
e of
the information contained herein is strictly prohibited.
=0D
--_000_88CCC2A657757A4EBDB4B19CAD978E5927582F2220CMBEXMBX1corp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.5700.6" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial size=3D2>I need to=
 perform=20
the following transformation, any help will be appreciated,</FONT></SPAN></=
DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial size=3D2>-------- =
input xml=20
-------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial size=3D2>&lt;soape=
nv:Envelope=20
xmlns:soapenv=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.o=
rg/soap/envelope/</A>"=20
xmlns:xsd=3D"<A=20
href=3D"http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema<=
/A>"=20
xmlns:xsi=3D"<A=20
href=3D"http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/X=
MLSchema-instance</A>"&gt;<BR>&nbsp;&nbsp;=20
&lt;soapenv:Body&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;ns1:driveTimeDisResponse soapenv:encodingStyle=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xmlns:ns1=3D"<A=20
href=3D"http://routing.soap.geosolutions.be">http://routing.soap.geosolutio=
ns.be</A>"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;driveTimeDisReturn href=3D"#id0"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
&lt;/ns1:driveTimeDisResponse&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mul=
tiRef=20
id=3D"id0" soapenc:root=3D"0" soapenv:encodingStyle=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xsi:type=3D"ns2:SoapReturnDriveTime" xmlns:soapenc=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xmlns:ns2=3D"<A=20
href=3D"http://beans.soap.geosolutions.be">http://beans.soap.geosolutions.b=
e</A>"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;errorCode=20
xsi:type=3D"soapenc:string"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
&lt;errorMessage=20
xsi:type=3D"soapenc:string"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
&lt;routesInfo soapenc:arrayType=3D"ns2:GenRouteInfo[1]"=20
xsi:type=3D"soapenc:Array"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;routesInfo=20
href=3D"#id1"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/routesInfo&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;token=20
xsi:type=3D"soapenc:string"&gt;XXX&lt;/token&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
&lt;/multiRef&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;multiRef id=3D"id1"=
=20
soapenc:root=3D"0" soapenv:encodingStyle=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xsi:type=3D"ns3:GenRouteInfo" xmlns:ns3=3D"<A=20
href=3D"http://beans.soap.geosolutions.be">http://beans.soap.geosolutions.b=
e</A>"=20
xmlns:soapenc=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
&lt;distance=20
href=3D"#id2"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;=
time=20
href=3D"#id3"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/multiRef&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;multiRef id=3D"id2"=
=20
soapenc:root=3D"0" soapenv:encodingStyle=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xsi:type=3D"xsd:long" xmlns:soapenc=3D"<A=20
href=3D'http://schemas.xmlsoap.org/soap/encoding/">73770</multiRef'>http://=
schemas.xmlsoap.org/soap/encoding/"&gt;73770&lt;/multiRef</A>&gt;<BR>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;multiRef id=3D"id3" soapenc:root=3D"0" soapenv:encodingStyle=3D"<A=20
href=3D"http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.o=
rg/soap/encoding/</A>"=20
xsi:type=3D"xsd:long" xmlns:soapenc=3D"<A=20
href=3D'http://schemas.xmlsoap.org/soap/encoding/">2884</multiRef'>http://s=
chemas.xmlsoap.org/soap/encoding/"&gt;2884&lt;/multiRef</A>&gt;<BR>&nbsp;&n=
bsp;=20
&lt;/soapenv:Body&gt;<BR>&lt;/soapenv:Envelope&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>-------------------------------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial size=3D2>--- expec=
ted output=20
----</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>&lt;AAA&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>&lt;distance&gt;73770<SPAN class=3D381553411-05082008><FONT face=
=3DArial=20
size=3D2>&lt;/distance&gt;</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial size=3D2><SPAN=20
class=3D381553411-05082008>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>&lt;time&gt;2884<SPAN class=3D381553411-05082008><FONT face=3DAria=
l=20
size=3D2>&lt;/time&gt;</FONT></SPAN></FONT></SPAN></DIV></SPAN></FONT></SPA=
N></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>&lt;/AAA&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=3D381553411-05082008><FONT face=3DArial=20
size=3D2>---------------------------------</FONT></SPAN></DIV></BODY></HTML=
>

<pre>--------------------------------------------------------------------=
----------

CONFIDENTIALITY AND DISCLAIMER NOTICE

This e-mail, including any attachments, is confidential and intended only=
 for
the addressee. If you are not the intended recipient, please notify us
immediately and delete this e-mail from your system. Any use or disclosur=
e of
the information contained herein is strictly prohibited.
=0D
--_000_88CCC2A657757A4EBDB4B19CAD978E5927582F2220CMBEXMBX1corp_--