Skip to Content
avatar image
Former Member

User Defined Mapping

Hi All,

My Source Structure is

<root>

<Header>

<BankCode>8911</BankCode>

<Bank>State Bank Of India</Bank>

</Header>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000981</ChequeNo>

<Amount>10000</Amount>

</Detail>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000982</ChequeNo>

<Amount>50000</Amount>

</Detail>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000983</ChequeNo>

<Amount>45000</Amount>

</Detail>

</root>

My Target Structure is

<Header>

<BankCode>8911</BankCode>

<Bank>State Bank Of India</Bank>

</Header>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000981</ChequeNo>

<Amount>10000</Amount>

</Detail>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000982</ChequeNo>

<Amount>50000</Amount>

</Detail>

<Detail>

<AccountNo>12345</AccountNo>

<ChequeNo>000983</ChequeNo>

<Amount>45000</Amount>

</Detail>

<Trailer>

<TotalCheques>3</TotalCheques>

<Total>105000</Total>

</Trailer>

</root>

My requirement is to add all the amount fields in Detail Node (1:Unbounded) and put it into Total field in Trailer Node (1:1)

I thought of using ResultList and parsing it. If any better solution is there then please Suggest me a Solution.

Thanks in advance.

Regards

Nagesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 14, 2006 at 03:44 AM

    Hi Nagesh,

    You can use the SUM function available in Graphical mapping.

    AMOUNT --> REMOVE CONTEXT --> SUM --> TARGET FIELD

    Regards,

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 14, 2006 at 03:49 AM

    Hi,

    Since the details node is 0..ub, I guess you would have to make use of ResultList in a UDF.

    You would have to take all the amount tags as input to the UDF, using a String array, and add them by looping through this array.

    Regards,

    Smitha.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 14, 2006 at 03:46 AM

    Hi,

    Map

    Amount sum(Statistics) Total

    Please try changing the context if the direct mapping does not help.

    Regards

    Vijaya

    Add comment
    10|10000 characters needed characters exceeded