Complex Flat File

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Complex Flat File

Viewing 0 reply threads
  • Author
    Posts
    • #20572

      We’re trying to take a “complex” flat file and turn it into XML.
      The second header record “100002” and all its detail is appearing in the “Total” node of the first record when it is processed through our map (<Total>5 H100002 LCar 2 LBike 3 T6</Total>).
      We can’t figure out why this is. Can anyone help?

       this is our input file:

      H100001
      LCar     2
      LBike    3
      LBike    3
      LBike    3
      T5
      H100002
      LCar     2
      LBike    3
      T6

      This is our schema:

        <?xml version=”1.0″ encoding=”utf-16″ ?>
      – <xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003” xmlns=”http://Project.order5” targetNamespace=”http://Project.order5” xmlns:xs=”http://www.w3.org/2001/XMLSchema“>
      – <xs:annotation>
      – <xs:appinfo>
        <schemaEditorExtension:schemaInfo namespaceAlias=”b” extensionClass=”Microsoft.BizTalk.FlatFileExtension.FlatFileExtension” standardName=”Flat File” xmlns:schemaEditorExtension=”http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions” />
        <b:schemaInfo standard=”Flat File” codepage=”65001″ default_pad_char=”” pad_char_type=”char” count_positions_by_byte=”false” parser_optimization=”complexity” lookahead_depth=”0″ suppress_empty_nodes=”false” generate_empty_nodes=”true” allow_early_termination=”true” early_terminate_optional_fields=”false” allow_message_breakup_of_infix_root=”false” compile_parse_tables=”false” root_reference=”Root” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:element name=”Root”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:recordInfo structure=”delimited” child_delimiter_type=”hex” child_order=”infix” sequence_number=”1″ preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” child_delimiter=”0x0D 0x0A” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:complexType>
      – <xs:sequence>
      – <xs:annotation>
      – <xs:appinfo>
        <groupInfo sequence_number=”0″ xmlns=”http://schemas.microsoft.com/BizTalk/2003” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:element minOccurs=”1″ maxOccurs=”unbounded” name=”HDR”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:recordInfo structure=”positional” tag_name=”H” tag_offset=”0″ sequence_number=”1″ preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” repeating_delimiter_type=”char” repeating_delimiter=”” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:complexType>
      – <xs:sequence>
      – <xs:annotation>
      – <xs:appinfo>
        <groupInfo sequence_number=”0″ xmlns=”http://schemas.microsoft.com/BizTalk/2003” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:element name=”HDR_Child1″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”1″ sequence_number=”1″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
      – <xs:element name=”HDR_Child3″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”6″ sequence_number=”2″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
      – <xs:element minOccurs=”1″ maxOccurs=”unbounded” name=”DTL”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:recordInfo structure=”positional” tag_name=”L” tag_offset=”0″ sequence_number=”2″ preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:complexType>
      – <xs:sequence>
      – <xs:annotation>
      – <xs:appinfo>
        <groupInfo sequence_number=”0″ xmlns=”http://schemas.microsoft.com/BizTalk/2003” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:element name=”DTL_Child1″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”1″ sequence_number=”1″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
      – <xs:element name=”DTL_Child2″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”8″ sequence_number=”2″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
      – <xs:element name=”DTL_Child3″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”1″ sequence_number=”3″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
      – <xs:element minOccurs=”1″ maxOccurs=”1″ name=”TOT”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:recordInfo structure=”positional” tag_name=”T” tag_offset=”0″ sequence_number=”3″ preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:complexType>
      – <xs:sequence>
      – <xs:annotation>
      – <xs:appinfo>
        <groupInfo sequence_number=”0″ xmlns=”http://schemas.microsoft.com/BizTalk/2003” />
        </xs:appinfo>
        </xs:annotation>
      – <xs:element name=”TOT_Child1″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”1″ sequence_number=”1″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
      – <xs:element name=”TOT_Child2″ type=”xs:string”>
      – <xs:annotation>
      – <xs:appinfo>
        <b:fieldInfo justification=”left” pos_offset=”0″ pos_length=”1″ sequence_number=”2″ />
        </xs:appinfo>
        </xs:annotation>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>

      This is the result:

        <?xml version=”1.0″ encoding=”utf-8″ ?>
      – <ns0:Delete xmlns:ns0=”http://Project.Order_Out“>
      – <HDR>
        <DocNo>100001</DocNo>
      – <ThisIsTheLine>
        <Desc>Car</Desc>
        <Qty>2</Qty>
        </ThisIsTheLine>
      – <ThisIsTheLine>
        <Desc>Bike</Desc>
        <Qty>3</Qty>
        </ThisIsTheLine>
      – <ThisIsTheLine>
        <Desc>Bike</Desc>
        <Qty>3</Qty>
        </ThisIsTheLine>
      – <ThisIsTheLine>
        <Desc>Bike</Desc>
        <Qty>3</Qty>
        </ThisIsTheLine>
        <Total>5 H100002 LCar 2 LBike 3 T6</Total>
        </HDR>
        </ns0:Delete>

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.