My XML structure:
---------------------------
<INVOICE>
<TASKS>
<TASK ID=1000 NUMBER="01.A001">
<TASK ID=2000 NUMBER="01.A002">
<TASK ID=3000 NUMBER="01.B001">
<TASK ID=4000 NUMBER="01.B005">
</TASKS>
<LINE>
<TASK>1000</TASK>
<AMOUNT>$1000</AMOUNT>
</LINE>
<LINE>
<TASK>1000</TASK>
<AMOUNT>$2000</AMOUNT>
</LINE>
<LINE>
<TASK>2000</TASK>
<AMOUNT>$2000</AMOUNT>
</LINE>
<LINE>
<TASK>3000</TASK>
<AMOUNT>$3000</AMOUNT>
</LINE>
<LINE>
<TASK>4000</TASK>
<AMOUNT>$5000</AMOUNT>
</LINE>
</INVOICE>
---------------------------
Desired HTML output:
---------------------------
Task Amount
01.A $4000 ($1000+$2000+2000)
01.B $8000 ($3000+$5000)
---------------------------
Task is taken from the first 4 chars of INVOICE/TASKS/TASK/@NUMBER and group them together.
The challenge for me is how to look up the TASKS/TASK/@NUMBER in LINE/TASK/@text().
If a single XSL can not achieve this, can you tell me how to insert TASKS/TASK/@NUMBER into LINE/TASK/@NUMBER so the LINE would be like
-------
<LINE>
<TASK NUMBER="01.A001">1000</TASK>
<AMOUNT>$1000</AMOUNT>
</LINE>
-----
Any suggestion? Thank you.
---------------------------
<INVOICE>
<TASKS>
<TASK ID=1000 NUMBER="01.A001">
<TASK ID=2000 NUMBER="01.A002">
<TASK ID=3000 NUMBER="01.B001">
<TASK ID=4000 NUMBER="01.B005">
</TASKS>
<LINE>
<TASK>1000</TASK>
<AMOUNT>$1000</AMOUNT>
</LINE>
<LINE>
<TASK>1000</TASK>
<AMOUNT>$2000</AMOUNT>
</LINE>
<LINE>
<TASK>2000</TASK>
<AMOUNT>$2000</AMOUNT>
</LINE>
<LINE>
<TASK>3000</TASK>
<AMOUNT>$3000</AMOUNT>
</LINE>
<LINE>
<TASK>4000</TASK>
<AMOUNT>$5000</AMOUNT>
</LINE>
</INVOICE>
---------------------------
Desired HTML output:
---------------------------
Task Amount
01.A $4000 ($1000+$2000+2000)
01.B $8000 ($3000+$5000)
---------------------------
Task is taken from the first 4 chars of INVOICE/TASKS/TASK/@NUMBER and group them together.
The challenge for me is how to look up the TASKS/TASK/@NUMBER in LINE/TASK/@text().
If a single XSL can not achieve this, can you tell me how to insert TASKS/TASK/@NUMBER into LINE/TASK/@NUMBER so the LINE would be like
-------
<LINE>
<TASK NUMBER="01.A001">1000</TASK>
<AMOUNT>$1000</AMOUNT>
</LINE>
-----
Any suggestion? Thank you.