BizTalk Server General - XML to FlatFile repeated nodes (output Multiple records) - Pls help!

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > February 2005 > XML to FlatFile repeated nodes (output Multiple records) - Pls help!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XML to FlatFile repeated nodes (output Multiple records) - Pls help!
Kamal

2005-02-10, 5:52 pm


Hi everyone,

I've got a little problem and I need help urgently please.

I've got 2 Schemas (an XML schema and Flat file schema), i've created a map
to map both of them. in the XML schema, i've got repeated nodes such as the
one below:

<Statement>
<Details>
<Charges>
<ChargeId>CO1</ChargeId>
<ChargeAmount>77.00</ChargeAmount>
</Charges>
<Charges>
<ChargeId>CO2</ChargeId>
<ChargeAmount>60.00</ChargeAmount>
</Charges>
<Charges>
<ChargeId>SAL</ChargeId>
<ChargeAmount>70.00</ChargeAmount>
</Charges>
</Details>
</Statement>
<Statement>
:::::::::::::::
</Statement>
<Statement>
:::::::::::::::
</Statement>

In the map, i've created a script that look like the following:

public float GetCharges(string ChargeId, string ChargeAmount)
{
float co1Charge = 0.0;
float co2Charge = 0.0;
float total = 0.0;

if(ChargeId = = "CO1")
co1Charge = ChargeAmount;

if(ChargeId = = "CO2")
co2Charge = ChargeAmount;

total = co1Charge + co2Charge;

return total;
}

Currently, the above goes ONLY through the FIRST Statement node, the FIRST
Details node and the FIRST Charges node and get the first charge ONLY and
perform the scripts. In addition, it only output a single record where there
are at least 10 records.

Any idea how to get it to loop through all charges and perform the above
script. And loop through the rest of the records and produce the next
records...etc..

Please help, any help, comments, links or tutorials would be very much
appreciated....

Thank you,.

Kamal



Kamal

2005-02-15, 7:55 am

Any help pls!!!



"Kamal" <kali@bca-group.comNOSPAMPLEASE> wrote in message
news:OWMuA34DFHA.1188@tk2msftngp13.phx.gbl...
>
> Hi everyone,
>
> I've got a little problem and I need help urgently please.
>
> I've got 2 Schemas (an XML schema and Flat file schema), i've created a

map
> to map both of them. in the XML schema, i've got repeated nodes such as

the
> one below:
>
> <Statement>
> <Details>
> <Charges>
> <ChargeId>CO1</ChargeId>
> <ChargeAmount>77.00</ChargeAmount>
> </Charges>
> <Charges>
> <ChargeId>CO2</ChargeId>
> <ChargeAmount>60.00</ChargeAmount>
> </Charges>
> <Charges>
> <ChargeId>SAL</ChargeId>
> <ChargeAmount>70.00</ChargeAmount>
> </Charges>
> </Details>
> </Statement>
> <Statement>
> :::::::::::::::
> </Statement>
> <Statement>
> :::::::::::::::
> </Statement>
>
> In the map, i've created a script that look like the following:
>
> public float GetCharges(string ChargeId, string ChargeAmount)
> {
> float co1Charge = 0.0;
> float co2Charge = 0.0;
> float total = 0.0;
>
> if(ChargeId = = "CO1")
> co1Charge = ChargeAmount;
>
> if(ChargeId = = "CO2")
> co2Charge = ChargeAmount;
>
> total = co1Charge + co2Charge;
>
> return total;
> }
>
> Currently, the above goes ONLY through the FIRST Statement node, the FIRST
> Details node and the FIRST Charges node and get the first charge ONLY and
> perform the scripts. In addition, it only output a single record where

there
> are at least 10 records.
>
> Any idea how to get it to loop through all charges and perform the above
> script. And loop through the rest of the records and produce the next
> records...etc..
>
> Please help, any help, comments, links or tutorials would be very much
> appreciated....
>
> Thank you,.
>
> Kamal
>
>
>



Nabeel Prior

2005-02-15, 7:55 am

A few questions:

1. Does the "Statement" node have a parent?
2. What should the output look like?
3. Have you tried using the "looping" functoid, linking the Charges node to
its equivalent output?
4. Can you post your input schema, input sample, map and output schema?


--

Kind Regards,

Nabeel Prior
Web: http://www.brainjar.co.za
Blog: http://www.brainjar.co.za/blog.aspx


"Kamal" <kali@bca-group.comNOSPAMPLEASE> wrote in message
news:O4dwAL0EFHA.3908@TK2MSFTNGP12.phx.gbl...
> Any help pls!!!
>
>
>
> "Kamal" <kali@bca-group.comNOSPAMPLEASE> wrote in message
> news:OWMuA34DFHA.1188@tk2msftngp13.phx.gbl...
> map
> the
> there
>
>



Kamal

2005-02-15, 7:55 am

Could you email it to me on the email address specified above (after
removing NOSPAMPLEASE), the attachement has been removed by the security
software i believe.

I greatly appreciate your support. Thank you.

Kamal

"Nabeel Prior" <nowhere@somewhere.com> wrote in message
news:OSZgvE1EFHA.3636@TK2MSFTNGP09.phx.gbl...
> Try this map out - let me know if it does the trick, or if something is
> still missing.
>
> --
>
> Kind Regards,
>
> Nabeel Prior
> Web: http://www.brainjar.co.za
> Blog: http://www.brainjar.co.za/blog.aspx
>
>
> "Kamal" <kali@bca-group.comNOSPAMPLEASE> wrote in message
> news:%23WWjqk0EFHA.1408@TK2MSFTNGP10.phx.gbl...
whether[vbcol=seagreen]
node[vbcol=seagreen]
created[vbcol=seagreen]
ONLY[vbcol=seagreen]
where[vbcol=seagreen]
next[vbcol=seagreen]
much[vbcol=seagreen]
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com