xsl-list
[Top] [All Lists]

Sort & Max simultaneous operations

2003-08-30 00:36:47
Hi All, 
        I have a xml  which has the structure below. I need to pick the rows 
with attribute distinct C1 & the corresponding max attribute of C2 ...  What is 
the best way to the same ? 

Input xml :

<PickList>
    <TotalRows>33</TotalRows>
    <Columns C1="Deposit" C2="Period" C3="Status" C4="Value Date" C5="Maturity 
Date" C6="Deposit No"/>
    <Tags>ctlMskDepositNo *</Tags>
    <Rows>
        <Row C1="1" C2="1" C3="Closed " C4="23/10/2003" C5="23/04/2004" C6="1"/>
        <Row C1="1" C2="2" C3="Closed " C4="23/10/2003" C5="23/04/2004" C6="2"/>
        <Row C1="1" C2="3" C3="Closed " C4="23/10/2003" C5="23/04/2004" C6="3"/>
        <Row C1="1" C2="4" C3="Closed " C4="23/10/2003" C5="23/04/2004" C6="4"/>
        <Row C1="1" C2="5" C3="Matured " C4="23/10/2003" C5="23/04/2004" 
C6="5"/>
        <Row C1="1" C2="6" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="6"/>

        <Row C1="2" C2="1" C3="Closed" C4="23/10/2003" C5="23/04/2004" C6="7"/>
        <Row C1="2" C2="2" C3="Closed" C4="23/10/2003" C5="23/04/2004" C6="8"/>
        <Row C1="2" C2="3" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="9"/>
        <Row C1="2" C2="3" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="10"/>
        <Row C1="3" C2="1" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="11"/>
        <Row C1="4" C2="1" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="12"/>
        <Row C1="5" C2="1" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="13"/>

        <Row C1="5" C2="8" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="13"/>
        <Row C1="5" C2="6" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="11"/>
        <Row C1="5" C2="7" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="12"/>
    </Rows>
</PickList>


the reqd output:

<Rows>
<Row C1="1" C2="6" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="6"/>
<Row C1="2" C2="3" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="9"/>
<Row C1="2" C2="3" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="10"/>
<Row C1="3" C2="1" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="11"/>
<Row C1="4" C2="1" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="12"/>
<Row C1="5" C2="8" C3="Open" C4="23/10/2003" C5="23/04/2004" C6="12"/>
</Rows>

Thank you,

Regards,
aruniima





DISCLAIMER:
This message contains privileged and confidential information and is intended 
only for the individual named.If you are not the intended recipient you should 
not disseminate,distribute,store,print, copy or deliver this message.Please 
notify the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system.E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be 
intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain 
viruses.The sender therefore does not accept liability for any errors or 
omissions in the contents of this message which arise as a result of e-mail 
transmission. If verification is required please request a hard-copy version.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>