Hi,

I need below output for the input:

We need to combine the documents with combination of Date and Type


Input:

<Collections>
    <Collection No="0004157">
        <Document Date="2014-09-24" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0004157" Name="xcfty" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="ekff" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="fusifufj" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="CAdww" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2014-09-24" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0014157" Name="abaheue" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2014-09-24" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0024157" Name="ytrgebsd" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2015-02-25" Type="XYZ">
            <Counterparties>
                <Counterparty ClonedCollection="0004157" Name="rtryy" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="gdgdgdg" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="rryrhjtj" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="dgdgdgdg" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2015-02-25" Type="XYZ">
            <Counterparties>
                <Counterparty ClonedCollection="0014157" Name="gggdgd" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2015-02-25" Type="XYZ">
            <Counterparties>
                <Counterparty ClonedCollection="0024157" Name="bcbbccbb" 
Status="Active"/>
            </Counterparties>
        </Document>
    </Collection>
    <Collection No="0004302">
        <Document Date="2014-11-10" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0004302" Name="Invesco Active 
Multi-Sector Credit Fund, a sub-fund of Invesco Funds" Status="Active"/>
                <Counterparty ClonedCollection="0004302" Name="Invesco Asia 
Balanced Fund, a sub-fund of Invesco Funds" Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2014-11-10" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0014302" Name="Invesco Active 
Multi-Sector Credit Fund, a sub-fund of Invesco Funds" Status="Active"/>
            </Counterparties>
        </Document>
    </Collection>
    </Collections>

Ouput:


<Collections>
    <Collection No="0004157">
        <Document Date="2014-09-24" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0004157" Name="xcfty" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="ekff" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="fusifufj" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="CAdww" 
Status="Active"/>
                <Counterparty ClonedCollection="0014157" Name="abaheue" 
Status="Active"/>
                <Counterparty ClonedCollection="0024157" Name="ytrgebsd" 
Status="Active"/>
            </Counterparties>
        </Document>
        <Document Date="2015-02-25" Type="XYZ">
            <Counterparties>
                <Counterparty ClonedCollection="0004157" Name="rtryy" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="gdgdgdg" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="rryrhjtj" 
Status="Active"/>
                <Counterparty ClonedCollection="0004157" Name="dgdgdgdg" 
Status="Active"/>
                <Counterparty ClonedCollection="0014157" Name="gggdgd" 
Status="Active"/>
                <Counterparty ClonedCollection="0024157" Name="bcbbccbb" 
Status="Active"/>
            </Counterparties>
        </Document>
    </Collection>
    <Collection No="0004302">
        <Document Date="2014-11-10" Type="ABC">
            <Counterparties>
                <Counterparty ClonedCollection="0004302" Name="Invesco Active 
Multi-Sector Credit Fund, a sub-fund of Invesco Funds" Status="Active"/>
                <Counterparty ClonedCollection="0004302" Name="Invesco Asia 
Balanced Fund, a sub-fund of Invesco Funds" Status="Active"/>
                <Counterparty ClonedCollection="0014302" Name="Invesco Active 
Multi-Sector Credit Fund, a sub-fund of Invesco Funds" Status="Active"/>
            </Counterparties>
        </Document>
    </Collection>
</Collections>

Thanks
Pragya



"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to