Optional elements in delimited record XSD

Hi,

I have a very complex flat file which looks like this.

FFM/8
1/AI0123/12JAN1212/BOM/reg12/GB/12JAN1212LHR
DXB/Nil/12JAN1212/12JAN1212
098-12345678BOMLHR/S5000W12KG12DI49S5000/Goods
/SHA/SHA
DIM/W12/CM12345-234-567/5555
/BOMAI0123/12FEB
/M
Lin/OSIBULK1
/OSIBULK2
COR/C
OCI/GB/Inf/C/Supplementary_Cust
LAST

From Third line to second last line is a repeating group like-

DXB/Nil/12JAN1212/12JAN1212
098-12345678BOMLHR/S5000W12KG12DI49S5000/Goods
/SHA/SHA
DIM/W12/CM12345-234-567/5555
/BOMAI0123/12FEB
/M
Lin/OSIBULK1
/OSIBULK2
COR/C
OCI/GB/Inf/C/Supplementary_Cust

In this group all the lines are optional except first line. And only last line has a tag identifier "OCI". further in first line i.e. "DXB/Nil/12JAN1212/12JAN1212" contains "/" delimiter. and in this record only first element is mandatory rest are conditional or optional. this continues with every other line.

I dont know how to proceed with such file. Any help would be appreciated.

Regards,

Alok Tripathi







  • Edited by aloktripathi Monday, June 04, 2012 12:46 PM wrong description
  • Changed type aloktripathi Monday, June 04, 2012 1:56 PM
June 4th, 2012 3:42pm

Hi Alok, 

This xsd is realy complex.

In my opnion, first you have to create a decode pipeline to put some tag identifier.

Without a identifier, the Biztalk have no idea how to treat this flat file.

Second, you have follow this tuto http://www.biztalkbrasil.com.br/2011/04/flat-file-hierarquico.html, to create hierarchy between tags.

This tuto is in portguese but you could use google tradutor

Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 5:36pm

One thing you can try is making sure the "Parser Optimization" is set to "Complexity".  You can also try increasing the lookahead depth ... try increasing it to about 10 and slowly increase it to see if it can parse the data correctly.

If this doesn't work, I can take a look at it to see if I can get it working.  My MSDN email is ddownin@hotmail.com

June 4th, 2012 6:00pm

I thought this might be a good place to post some additional specifics related to how the flat file parser matches records during the parse.  Although tags provide the most efficient method for parsing flat file data, the parser can also do basic matching by structure.  Because of this, you can modify the structure in such a way as to assist in the parsing of a flat file.  This is especially true when adjacent records are related in some way.  Looking at the data above, it seems like many of the optional records have tags and are related to some of the adjacent following children.

As an example the data relating to this post might relate as follows (schema also included below for reference):

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BTSProto.Alok.Schemas.AlokFFSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://BTSProto.Alok.Schemas.AlokFFSchema" 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="13" 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" root_reference="Root" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" 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="Header">
          <xs:annotation>
            <xs:appinfo>
              <recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D" child_order="infix" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
            </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="FFM">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo tag_name="FFM" structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
                  </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="Root_Child1_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Header_Line2">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="infix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="2" />
                  </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="Root_Child2_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child2" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="2" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child3" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="3" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child4" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="4" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child5" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="5" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child6" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="6" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child2_Child7" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="7" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="unbounded" name="Repeating">
          <xs:annotation>
            <xs:appinfo>
              <recordInfo sequence_number="2" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_order="infix" child_delimiter="0x0D 0x0A" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
            </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="0" name="DXB_">
                <xs:annotation>
                  <xs:appinfo>
                    <recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_order="infix" child_delimiter="0x0D 0x0A" sequence_number="1" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                  </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="DXB">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="DXB" structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
                        </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="Root_Child3_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child3_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child3_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Goods">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="infix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="2" />
                        </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="Root_Child4_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child4_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child4_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="SHA">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="3" />
                        </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="Root_Child5_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child5_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="DIM_">
                <xs:annotation>
                  <xs:appinfo>
                    <recordInfo sequence_number="2" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" child_order="infix" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                  </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="0" name="DIM">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="DIM" child_order="prefix" sequence_number="1" />
                        </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="Root_Child6_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child6_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child6_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Root_Child7">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="2" />
                        </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="Root_Child7_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Root_Child7_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Root_Child8">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="3" />
                        </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="Root_Child8_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="LIN_">
                <xs:annotation>
                  <xs:appinfo>
                    <recordInfo sequence_number="3" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" child_order="infix" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                  </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="0" name="Lin">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="Lin" child_order="prefix" sequence_number="1" />
                        </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="Root_Child9_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="Root_Child10">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="2" />
                        </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="Root_Child10_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="COR">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="4" tag_name="COR" />
                  </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="Root_Child10_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="OCI">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo tag_name="OCI" structure="delimited" child_delimiter_type="char" child_delimiter="/" child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="5" />
                  </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="Root_Child12_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child12_Child2" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="2" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child12_Child3" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="3" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Root_Child12_Child4" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="4" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="LAST">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo tag_name="LAST" structure="positional" child_delimiter_type="char" child_delimiter="/" child_order="infix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="3" tag_offset="0" />
            </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="Last" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="1" pos_length="4" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
NOTE: I also needed to increase the lookahead depth to 13 to correctly parse the sample.
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 7:56pm

Hi,

I have a very complex flat file which looks like this.

FFM/8
1/AI0123/12JAN1212/BOM/reg12/GB/12JAN1212LHR
DXB/Nil/12JAN1212/12JAN1212
098-12345678BOMLHR/S5000W12KG12DI49S5000/Goods
/SHA/SHA
DIM/W12/CM12345-234-567/5555
/BOMAI0123/12FEB
/M
Lin/OSIBULK1
/OSIBULK2
COR/C
OCI/GB/Inf/C/Supplementary_Cust
LAST

From Third line to second last line is a repeating group like-

DXB/Nil/12JAN1212/12JAN1212
098-12345678BOMLHR/S5000W12KG12DI49S5000/Goods
/SHA/SHA
DIM/W12/CM12345-234-567/5555
/BOMAI0123/12FEB
/M
Lin/OSIBULK1
/OSIBULK2
COR/C
OCI/GB/Inf/C/Supplementary_Cust

In this group all the lines are optional except first line. And only last line has a tag identifier "OCI". further in first line i.e. "DXB/Nil/12JAN1212/12JAN1212" contains "/" delimiter. and in this record only first element is mandatory rest are conditional or optional. this continues with every other line.

I dont know how to proceed with such file. Any help would be appreciated.

Regards,

Alok Tripathi


Dear Mrs Alok Tripathi

Can you tell me how to convert message cimp to xml

thanks






January 18th, 2014 10:41am

Dear Mrs aloktripathi,

Can you tell me how to create schema for CARGO message (FFM, FHL, FWB,..)

Thanks

Free Windows Admin Tool Kit Click here and download it now
January 20th, 2014 5:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics