View Single Post
  #1 (permalink)  
Old May 5th, 2010, 09:10 AM
Divya Divya is offline
Authorized User
 
Join Date: Apr 2010
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Default How to process multiple input xml files with a single xslt ?

Hi,
1.I have three xmls.typeid in the first XML must be matched with multiple occurances of id field of second xml. if it matches we have to retrieve 'rfs' attribute and put it in output xml.
2.valueid in the first xml must be matched with multiple occurances of id field of third xml. if any of the id field matches with valueid we have retrieve 'code' attribute and put it in output xml.

First XML:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<Response xmlns="http://test.com">
<Result>
<List>
<typeid>1</typeid>
<valueid>7</valueid>
<agentname>Ajay</agentname>
<Addess1>NewStreet</Addess1>
</List>
</Result>
</Response>
</soap:Body>
</soap:Envelope>

Second XML:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<Response xmlns="http://test.com">
<Result>
<info>
<id>1</id>
<rfs>Accumulation</rfs>
</info>
<info>
<id>0</id>
<rfs>Distribution</rfs>
</info>
</Result>
</Response>
</soap:Body>
</soap:Envelope>


Third XML:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<Response xmlns="http://test.com">
<Result>
<info>
<id>1</id>
<code>U</code>
</info>
<info>
<id>2</id>
<code>C</code>
</info>
<info>
<id>3</id>
<code>A</code>
</info>
<info>
<id>7</id>
<code>E</code>
</info>
</Result>
</Response>
</soap:Body>
</soap:Envelope>


Output xml should be like :

<Row>
<rfs>Accumulation</rfs>
<code>E</code>
<agentname>Ajay</agentname>
<Addess1>NewStreet</Addess1>
</Row>

Could any one please help in writing the xslt for this scenario.

Thanks,
Divya
Reply With Quote