I'm trying to create a schema for an incoming flat file containing edi 835 information. The file layout is really pretty simple. It contains 5 basic record types, each on a different line, fixed width. It looks like this:
0001 (header, occurs only once)
0002 (EOB info, start of record, this line occurs only once per record, but you can have multiple records per file)
0003(Service line info, can occur multiple times per record)
0004((Totals, occurs only once per record)
0007(Footer, occurs once per file)
Now, when I create the following schema, it reads the file and converts it to XML just fine, IF there is only one record:
However, when I try a file with multiple records, I get the following error:
"Unexpected data found while looking for:
The schema is not accepting that there can be multiple records. I tried arranging the schema like this, making records type 2,3 and 4 as sub records of type1.
This gives me the following error:
Unexpected data found while looking for:'0002'
This, in my opinion, should be a very easy schema to create. Am I missing something?
I dont think the way you are trying to work out this problem will take you through. BizTalk would not be able to understand what kind of a record it is as the records 2,3 ,4 are unbounded. You need to have a tag identifier with each of the record in order to let BizTalk know what kind of record it is.
So if your record begins with 002, 003 and subsequently you have to go on the record node and specify the tag identifier. This will help BizTalk identify the record correctly. When you do this remember to reoder your records correctly as tag identifier will not be in the output xml for the flat file.