Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Flat file import wizard schema issue

BizTalk 2010

This group is for all content related to BizTalk Server 2010. This includes a forum and samples.

Flat file import wizard schema issue

Answered (Not Verified) This question has suggested answer(s)

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:

0001(record)

0002(record, unbounded)

0003(record, unbounded)

0003(record, unbounded)

0003(record, unbounded)

0004(record, unbounded)

0007(record)

 

However, when I try a file with multiple records, I get the following error:

"Unexpected data found while looking for:

'0007''0004'

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.

0001

----0002(record, unbounded)

----0003(record, unbounded)

----0004(record, unbounded)

0007

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?

Thanks.

All Replies
  • Hi

    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.

    Puneet

    • Not Ranked
  • Here is a schema that will parse what you request. Just added a field after the tag identifiers to test, so the tested file looks like this:

     

    000111

    000222

    000333

    000334

    000444

    000223

    000335

    000445

    000777

     

    Here is the schema:

    <?xml version="1.0" encoding="utf-16" ?> 

    - <xs:schema xmlns="http://BizTalk_Server_Project1.FlatFileSchema1" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://BizTalk_Server_Project1.FlatFileSchema1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:schemaInfo standard="Flat File" root_reference="Root" default_pad_char="" pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" /> 

    <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Root"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" child_order="postfix" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element minOccurs="1" maxOccurs="1" name="node0001"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo sequence_number="1" structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="0001" child_delimiter_type="hex" child_order="infix" child_delimiter="0x0D 0x0A" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Tag" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="1" justification="left" pos_length="4" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    - <xs:element name="Field" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="2" justification="left" pos_length="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    - <xs:element minOccurs="1" maxOccurs="999999" name="Loop"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo sequence_number="2" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element minOccurs="1" maxOccurs="1" name="node0002"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="0002" child_order="infix" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" sequence_number="1" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Tag" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="1" justification="left" pos_length="4" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    - <xs:element name="Field" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="2" justification="left" pos_length="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    - <xs:element minOccurs="1" maxOccurs="999999" name="node0003"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="0003" sequence_number="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Tag" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="1" justification="left" pos_length="4" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    - <xs:element name="Field" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="2" justification="left" pos_length="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    - <xs:element minOccurs="1" maxOccurs="1" name="node0004"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="0004" sequence_number="3" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Tag" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="1" justification="left" pos_length="4" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    - <xs:element name="Field" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="2" justification="left" pos_length="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    - <xs:element minOccurs="1" maxOccurs="1" name="node0007"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:recordInfo sequence_number="3" structure="positional" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="0007" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:complexType> 

    - <xs:sequence> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:groupInfo sequence_number="0" /> 

    </xs:appinfo> 

    </xs:annotation> 

    - <xs:element name="Tag" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="1" justification="left" pos_length="4" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    - <xs:element name="Field" type="xs:string"> 

    - <xs:annotation> 

    - <xs:appinfo> 

    <b:fieldInfo sequence_number="2" justification="left" pos_length="2" /> 

    </xs:appinfo> 

    </xs:annotation> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    </xs:sequence> 

    </xs:complexType> 

    </xs:element> 

    </xs:schema>

     

     

    • Not Ranked
    Suggested by
Page 1 of 1 (3 items)