Ani

Ani

  • 169
  • 11.2k
  • 34.6k

Multiple Sorting in xsl

Oct 26 2021 6:51 AM

Hi,

I have below xml and I want to have two tables with sorted data like first tabel should be sorted with term years and second table should be sorted with term years and claim type. please help me
first table 

  Term 1
(2020-09-20 to 2021-09-20)
Term 2
(2019-09-20 to 2020-09-20)
Term 3
(2018-09-20 to 2019-09-20)
No of claims 21 8 0
Claims Amount 4500000 340000 0

Second table

  Term 1 (2020-09-20 to 2021-09-20) Term 2 (2019-09-20 to 2020-09-20) Term 3 (2018-09-20 to 2019-09-20)
Coverage Number of claims Claims Amount Number of claims Claims Amount Number of claims Claims Amount
Loss 7 70000 4 40000 0 0
Theft 2 200000 2 100000 0 0
Fire 12 180000 2 200000 0 0

XML

<Data>
    <StateDetails>
        <ClaimDetails>
            <State>UP</State>
            <EffectiveDate>2020-09-20</EffectiveDate>
            <ExpirationDate>2021-09-20</ExpirationDate>
            <Claims id="c7059429FF5044F5F9E72F0D366693D24">
                <Type>LOSS</Type>
                <ClaimsPersonal>2</ClaimsPersonal>
                <ClaimsBusiness>1</ClaimsBusiness>
                <TotalClaims>3</TotalClaims>
                <ClaimsPersonalAmount>10000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>20000</ClaimsBusinessAmount>
                <ClaimsAmount>30000</ClaimsAmount>
            </Claims>
            <Claims id="xyz59429FF5677F5F9E72F0D366693C00">
                <Type>FIRE</Type>
                <ClaimsPersonal>5</ClaimsPersonal>
                <ClaimsBusiness>5</ClaimsBusiness>
                <TotalClaims>10</TotalClaims>
                <ClaimsPersonalAmount>50000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>30000</ClaimsBusinessAmount>
                <ClaimsAmount>80000</ClaimsAmount>
            </Claims>
            <Claims id="xyz77629FF5677F5F9E72F0D366693E12">
                <Type>THEFT</Type>
                <ClaimsPersonal>1</ClaimsPersonal>
                <ClaimsBusiness>1</ClaimsBusiness>
                <TotalClaims>2</TotalClaims>
                <ClaimsPersonalAmount>150000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>50000</ClaimsBusinessAmount>
                <ClaimsAmount>200000</ClaimsAmount>
            </Claims>
        </ClaimDetails>
        <ClaimDetails>
            <State>MP</State>
            <EffectiveDate>2020-09-20</EffectiveDate>
            <ExpirationDate>2021-09-20</ExpirationDate>
            <Claims id="c7059429FF5044F5F9E72F0D366693D24">
                <Type>LOSS</Type>
                <ClaimsPersonal>2</ClaimsPersonal>
                <ClaimsBusiness>2</ClaimsBusiness>
                <TotalClaims>4</TotalClaims>
                <ClaimsPersonalAmount>20000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>20000</ClaimsBusinessAmount>
                <ClaimsAmount>40000</ClaimsAmount>
            </Claims>
            <Claims id="xyz59429FF5677F5F9E72F0D366693C00">
                <Type>FIRE</Type>
                <ClaimsPersonal>1</ClaimsPersonal>
                <ClaimsBusiness>1</ClaimsBusiness>
                <TotalClaims>2</TotalClaims>
                <ClaimsPersonalAmount>50000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>50000</ClaimsBusinessAmount>
                <ClaimsAmount>100000</ClaimsAmount>
            </Claims>
        </ClaimDetails>
        <ClaimDetails>
            <State>MP</State>
            <EffectiveDate>2019-09-20</EffectiveDate>
            <ExpirationDate>2020-09-20</ExpirationDate>
            <Claims id="c7059429FF5044F5F9E72F0D3644493324">
                <Type>LOSS</Type>
                <ClaimsPersonal>2</ClaimsPersonal>
                <ClaimsBusiness>2</ClaimsBusiness>
                <TotalClaims>4</TotalClaims>
                <ClaimsPersonalAmount>20000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>20000</ClaimsBusinessAmount>
                <ClaimsAmount>40000</ClaimsAmount>
            </Claims>
            <Claims id="xyz59429FF5677F5F9E72F0D366693X11">
                <Type>FIRE</Type>
                <ClaimsPersonal>1</ClaimsPersonal>
                <ClaimsBusiness>1</ClaimsBusiness>
                <TotalClaims>2</TotalClaims>
                <ClaimsPersonalAmount>50000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>50000</ClaimsBusinessAmount>
                <ClaimsAmount>100000</ClaimsAmount>
            </Claims>
            <Claims id="xyz77629FF5677F5F9E72F0D36669SD12">
                <Type>THEFT</Type>
                <ClaimsPersonal>1</ClaimsPersonal>
                <ClaimsBusiness>1</ClaimsBusiness>
                <TotalClaims>2</TotalClaims>
                <ClaimsPersonalAmount>150000</ClaimsPersonalAmount>
                <ClaimsBusinessAmount>50000</ClaimsBusinessAmount>
                <ClaimsAmount>200000</ClaimsAmount>
            </Claims>
        </ClaimDetails>
    </StateDetails>
</Data>

 


Answers (1)