I have two xmls
a.xml
b.xml
Below is the a.xml
file
<proj_details>
<proj_detail>
<Username>Username</Username>
<ID>ID</ID>
<Place>Ocean</Place>
<City>Urban</City>
<!-- some more fields -->
</proj_detail>
<proj_detail>
<Username>abc@abc.com</Username>
<ID>QoChiX5FlqU7VB2MKw5Aa</ID>
<Place>Road</Place>
<City>Rural</City>
<!-- some more fields -->
</proj_detail>
<proj_detail>
<Username>abc@abc.com</Username>
<ID>uzGjRVxnZPtB9sfiXtga</ID>
<Place>Mud</Place>
<City>SemiRural</City>
<!-- some more fields -->
</proj_detail>
<proj_detail>
<Username>abc@abc.com</Username>
<ID>YChiX5FluqhuyVB2OPw5Aa</ID>
<Place>Sea</Place>
<City>Sealine</City>
<!-- some more fields -->
</proj_detail>
<proj_detail>
<Username>abc@abc.com</Username>
<ID>RD37oO2jgW5p6f76W8up</ID>
<Place>Lane</Place>
<City>Leftsidelane</City>
<!-- some more fields -->
</proj_detail>
</proj_details>
<!-- more fields -->
and below is the b.xml
<FilebDetail>
<Number>34</Number>
<CONS>abc@abc.com</CONS>
<PROD>xyz@xyz.com</PROD>
<ID>QoChiX5FlqU7VB2MKw5Aa</ID>
<Name>Directory/notepad</Name>
<Count>43</Count>
<time>43550.53333336</time>
<!-- some more fields-->
</FilebDetail>
<FilebDetail>
<Number>35</Number>
<CONS>abc@abc.com</CONS>
<PROD>cvb@cvb.com</PROD>
<ID>uzGjRVxnZPtB9sfiXtga</ID>
<Name>Speed/morning</Name>
<Count>42</Count>
<time>43550.5778</time>
<!-- some more fields-->
</FilebDetail>
<FilebDetail>
<Number>31</Number>
<CONS>abc@abc.com</CONS>
<PROD>cvb@cvb.com</PROD>
<ID>RD37oO2jgW5p6f76W8up</ID>
<Name>Weatherincity</Name>
<Count>12</Count>
<time>43550.498611111114</time>
<!-- some more fields-->
</FilebDetail>
</FilebDetails>
Now, I want to get the output somewhat like below
<proj_detail>
<Number>34</Number>
<CONS>abc@abc.com</CONS>
<PROD>xyz@xyz.com</PROD>
<ID>QoChiX5FlNyqe1FuqU7VB2M</ID>
<Name>Directory/notepad</Name>
<Count>12</Count>
<time>43550.498611111114</time>
<Place>Road</Place>
<City>Rural</City>
<!-- some more fields -->
</proj_detail>
<proj_detail>
<Number>35</Number>
<CONS>abc@abc.com</CONS>
<PROD>cvb@cvb.com</PROD>
<ID>uzGjRVxnxmP00zrnZPtB9sM</ID>
<Name>Speed/morning</Name>
<Count>42</Count>
<time>43550.5778</time>
<Place>Mud</Place>
<City>SemiRural</City>
</proj_detail>
<!-- some more fields -->
<proj_detail>
<Number>31</Number>
<CONS>abc@abc.com</CONS>
<PROD>cvb@cvb.com</PROD>
<ID>RD37oO2jg4rlerxW5p6f76</ID>
<Name>Weatherincity</Name>
<Count>12</Count>
<time>43550.498611111114</time>
<Place>Lane</Place>
<City>Leftsidelane</City>
</proj_detail>
<!-- some more fields -->
</proj_details>
In both files ID is common and that is what needs to be compared. Once its compared, then we the corresponding fields from both the files are to be printed.
I am pretty new in xslt. Any xslt version would be ok to use.
Any guidance in this would be really helpful.
Thanks