I need your help with a XSLT 1.0 problem.
Original XML:
<businessevent>
<catalog>
<de name="16R">FIN</de>
<ds name="35B">
<de name="instrument_identification">ISIN AT0000A0U3T4</de>
<de name="instrument_type">ISIN</de>
<de name="instrument_code">AT0000A0U3T4</de>
<de name="instrument_code_code">AT0000A0U3T4</de>
<de name="instrument_code_umi_id">ATG2022113.4</de>
<de name="instrument_code_code">AT0000A0U3T4</de>
<de name="instrument_code_umi_id">ATG2022113.4_SG</de>
</ds>
<de name="16R">FIA</de>
<de name="12A">:CLAS/ISIT/GOVT</de>
<ds name="98A">
<de name="date_type">MATU</de>
<de name="date">20051122</de>
</ds>
<ds name="98A">
<de name="date_type">ISSU</de>
<de name="date">20060126</de>
</ds>
<de name="92A">:INTR//3,4</de>
<de name="16S">FIA</de>
<de name="90A">:MRKT//PRCT/114,16</de>
<ds name="93B">
<de name="amount_type">AGGR</de>
<de name="unit_type">FAMT</de>
<de name="amount">100</de>
</ds>
<ds name="93B">
<de name="amount_type">AVAI</de>
<de name="unit_type">FAMT</de>
<de name="amount">100</de>
</ds>
<ds name="93B">
<de name="amount_type">NAVL</de>
<de name="unit_type">FAMT</de>
<de name="amount">0</de>
</ds>
<de name="16R">SUBBAL</de>
<ds name="93B">
<de name="amount_type">AGGR</de>
<de name="unit_type">FAMT</de>
<de name="amount">100</de>
</ds>
<de name="16S">SUBBAL</de>
<de name="19A">:HOLD//EUR6000,</de>
<de name="16S">FIN</de>
<de name="16R">FIN</de>
<ds name="35B">
<de name="instrument_identification">ISIN AT0000A0VRF9</de>
<de name="instrument_type">ISIN</de>
<de name="instrument_code">AT0000A0VRF9</de>
<de name="instrument_code_code">AT0000A0VRF9</de>
<de name="instrument_code_umi_id">ATG2019061.95</de>
</ds>
<de name="16R">FIA</de>
<de name="12A">:CLAS/ISIT/GOVT</de>
<ds name="98A">
<de name="date_type">MATU</de>
<de name="date">20120618</de>
</ds>
<ds name="98A">
<de name="date_type">ISSU</de>
<de name="date">20110703</de>
</ds>
<de name="92A">:INTR//1,95</de>
<de name="16S">FIA</de>
<de name="90A">:MRKT//PRCT/100,47</de>
<ds name="93B">
<de name="amount_type">AGGR</de>
<de name="unit_type">FAMT</de>
<de name="amount">200</de>
</ds>
<ds name="93B">
<de name="amount_type">AVAI</de>
<de name="unit_type">FAMT</de>
<de name="amount">200</de>
</ds>
<ds name="93B">
<de name="amount_type">NAVL</de>
<de name="unit_type">FAMT</de>
<de name="amount">0</de>
</ds>
<de name="16R">SUBBAL</de>
<ds name="93B">
<de name="amount_type">AGGR</de>
<de name="unit_type">FAMT</de>
<de name="amount">200</de>
</ds>
<de name="16S">SUBBAL</de>
<de name="19A">:HOLD//EUR1000,</de>
<de name="16S">FIN</de>
</catalog>
</businessevent>
As you can see it is a flat XML with a weird structure and I can only use XSLT 1.0 to manipulate it. The sub-structure repeats initiating with
<de name="16R">FIN</de>
and ends with
<de name="16S">FIN</de>
For each of this repeating structure I need to get some of the info and only the first occurrence of 93B with amount_type = AGGR. In the first "group" it repeats and its giving me problems.
Expected result:
<businessevent>
<catalog>
<ds>
<de name="instrument_identification">ISIN AT0000A0U3T4</de>
<de name="instrument_type">ISIN</de>
<de name="instrument_code">AT0000A0U3T4</de>
<de name="amount">100</de>
</ds>
</catalog>
</businessevent>
Thank you very much!