BizTalk Server General - Mapping Problem

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > February 2006 > Mapping Problem





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 Mapping Problem
gopal

2006-02-22, 2:47 am


-- Hi All,


i receive a flat file and i should generate an xml.
I receive a flat file which is having following structure.
File
Document1
Header
Vendor1
Accounting1
Accounting2
vendor2
Accounting3
Accounting4
Document1
Document2
Header
Vendor3
Accounting5
Accounting6
vendor4
Accounting7
Accounting8
Document2
File
each record is having tagidentifier 1 for document 2 for header 3 for vendor
4 for accounting.
one file can contain any no of documents.in one document it should conatain
one one header ,one vendor record followed by 2 accounting records ,next
vendor record followed by two accounting records and so on.
i created a schema in biztalk 2004 which i validated against an test file it
is generating xml correctly.in the destination also i created a similar
structure.

after mapping my source to destination, in the output --- inside the
document header followed by all vendor records in a document and then all
accounting records.

in my output xml iam getting
file
document
header
vendor1
vendor2
vendor3
Accounting1
Accounting2
Accounting3
document
file
but iam trying to get

File
Document
Header
vendor1
Accounting1
Accounting2
vendor2
Accounting3
Accounting4
Document
File

i have to generate the xml in the similar structure how i receive the data
in flatfile.

can some one help me asap.This is very urgent for me ....
Thanks in advance...




--
gopal
gopal
Greg Forsythe

2006-02-22, 2:47 am

You need to place the vendor info in a record like this;

File
Document1
Header
<VendorInfo>
Vendor1
Accounting1
Accounting2
</VendorInfo>
<VendorInfo>
vendor2
Accounting3
Accounting4
</VendorInfo>
Document1
File

You can do this on the flat file schema so your schema will look something
like this:

<Schema>
File delimiter = CRLF
Document delimiter = CRLF Maxoccurs = *
Header Tag = 2 delimiter = ,
VendorInfo
Vendor Tag = 3 delimiter = ,
Accounting Tag = 4 delimiter = , Maxoccurs = 2



Greg


"gopal" <gopal@discussions.microsoft.com> wrote in message
news:BBF08C89-E808-47D4-A1BA-652A57AC6148@microsoft.com...
>
> -- Hi All,
>
>
> i receive a flat file and i should generate an xml.
> I receive a flat file which is having following structure.
> File
> Document1
> Header
> Vendor1
> Accounting1
> Accounting2
> vendor2
> Accounting3
> Accounting4
> Document1
> Document2
> Header
> Vendor3
> Accounting5
> Accounting6
> vendor4
> Accounting7
> Accounting8
> Document2
> File
> each record is having tagidentifier 1 for document 2 for header 3 for
> vendor
> 4 for accounting.
> one file can contain any no of documents.in one document it should
> conatain
> one one header ,one vendor record followed by 2 accounting records ,next
> vendor record followed by two accounting records and so on.
> i created a schema in biztalk 2004 which i validated against an test file
> it
> is generating xml correctly.in the destination also i created a similar
> structure.
>
> after mapping my source to destination, in the output --- inside the
> document header followed by all vendor records in a document and then all
> accounting records.
>
> in my output xml iam getting
> file
> document
> header
> vendor1
> vendor2
> vendor3
> Accounting1
> Accounting2
> Accounting3
> document
> file
> but iam trying to get
>
> File
> Document
> Header
> vendor1
> Accounting1
> Accounting2
> vendor2
> Accounting3
> Accounting4
> Document
> File
>
> i have to generate the xml in the similar structure how i receive the data
> in flatfile.
>
> can some one help me asap.This is very urgent for me ....
> Thanks in advance...
>
>
>
>
> --
> gopal
> gopal



sanket.bakshi@gmail.com

2006-02-22, 7:47 am

Hi Gopal,
I would suggest having the Accounting nodes under Vendor and then
giving it the appropriate delimiters.

Do let me know if it helps.

Regards,
Sanket

gopal wrote:
> -- Hi All,
>
>
> i receive a flat file and i should generate an xml.
> I receive a flat file which is having following structure.
> File
> Document1
> Header
> Vendor1
> Accounting1
> Accounting2
> vendor2
> Accounting3
> Accounting4
> Document1
> Document2
> Header
> Vendor3
> Accounting5
> Accounting6
> vendor4
> Accounting7
> Accounting8
> Document2
> File
> each record is having tagidentifier 1 for document 2 for header 3 for vendor
> 4 for accounting.
> one file can contain any no of documents.in one document it should conatain
> one one header ,one vendor record followed by 2 accounting records ,next
> vendor record followed by two accounting records and so on.
> i created a schema in biztalk 2004 which i validated against an test file it
> is generating xml correctly.in the destination also i created a similar
> structure.
>
> after mapping my source to destination, in the output --- inside the
> document header followed by all vendor records in a document and then all
> accounting records.
>
> in my output xml iam getting
> file
> document
> header
> vendor1
> vendor2
> vendor3
> Accounting1
> Accounting2
> Accounting3
> document
> file
> but iam trying to get
>
> File
> Document
> Header
> vendor1
> Accounting1
> Accounting2
> vendor2
> Accounting3
> Accounting4
> Document
> File
>
> i have to generate the xml in the similar structure how i receive the data
> in flatfile.
>
> can some one help me asap.This is very urgent for me ....
> Thanks in advance...
>
>
>
>
> --
> gopal
> gopal


gopal

2006-02-22, 5:57 pm

Thank you so much for your quick reply

Source schema i followed simiarly

All Records are positional Records ending with CRLF

Document Tag = 1 Maxoccurs = unbounded delimiter = CRLF ChildOrder =
Postfix
Header Tag = 2
VenderInfo Maxoccurs = unbounded delimiter = CRLF ChildOrder =infix
vendor Tag = 3
Accounting Tag = 4 Maxoccurs = 2

But in Destination schema the structure is slightly different.if i add the
venderinfo record as in source schema it appers as a tag in output xml.to
avoid that i used the Sequence record type as placeholder to vendor and
accounting records .all properties are set accordingly.
But in the output xml i am getting all vendor records followed by accounting
records.
i should get the pattern one vendor followed by 2 accounting records.

i dont know if iam missing some property setting.do we need to use any
looping functoid.i tried using looping functoid also.still i am getting all
vendors followed by
Accounting records.

Thanks-
gopal


"Greg Forsythe" wrote:

> You need to place the vendor info in a record like this;
>
> File
> Document1
> Header
> <VendorInfo>
> Vendor1
> Accounting1
> Accounting2
> </VendorInfo>
> <VendorInfo>
> vendor2
> Accounting3
> Accounting4
> </VendorInfo>
> Document1
> File
>
> You can do this on the flat file schema so your schema will look something
> like this:
>
> <Schema>
> File delimiter = CRLF
> Document delimiter = CRLF Maxoccurs = *
> Header Tag = 2 delimiter = ,
> VendorInfo
> Vendor Tag = 3 delimiter = ,
> Accounting Tag = 4 delimiter = , Maxoccurs = 2
>
>
>
> Greg
>
>
> "gopal" <gopal@discussions.microsoft.com> wrote in message
> news:BBF08C89-E808-47D4-A1BA-652A57AC6148@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com