Hello,
I'm new to XSLT and I would like to know how to merge 2 XML streams before finally transforming it again.
The 2 streams are
Input 1
<Response>
<Instrument>
<Date value="2010-09-02">
<Quantity>10</Quantity>
</Date>
<DXLID>1</DXLID>
</Instrument>
<Instrument TICKER="APPL" />
<SF></SF>
<Instrument>
<Date value="2010-09-02">
<Quantity>20</Quantity>
</Date>
<DXLID>2</DXLID>
</Instrument>
<Instrument TICKER="APPL" />
<SF></SF>
</Response>
Input 2
<Response>
<IM>
<Instrument>
<Date value="2010-09-02">
<SAF>1</SAF>
<SAR>2</SAR>
</Date>
<DXLID>1</DXLID>
</Instrument>
<Instrument>
<Date value="2010-09-02">
<SAF>1</SAF>
<SAR>2</SAR>
</Date>
<DXLID>3</DXLID>
</Instrument>
</IM>
</Response>
Desired Output
<Response>
<All>
<Instrument>
<Date value="2010-09-02">
<SAF>1</SAF>
<SAR>2</SAR>
<Quantity>10</Quantity>
</Date>
<DXLID>1</DXLID>
</Instrument>
<Instrument>
<Date value="2010-09-02">
<Quantity>20</Quantity>
</Date>
<DXLID>2</DXLID>
</Instrument>
<Instrument>
<Date value="2010-09-02">
<SAF>1</SAF>
<SAR>2</SAR>
</Date>
<DXLID>3</DXLID>
</Instrument>
</All>
</Response>
The merge needs to be based on a match between the DXLID node value and the value attribute of the Date node.
Note also that the merge needs to be a merge both ways.
Thanks in advance
Neil