生成BTS平面文件架构,其中包含无限制的最大记录

时间:2016-11-14 18:25:29

标签: biztalk flat-file

我在使用BTS开发工具的Visual Studio中将输入文档的生成/创建模式作为flatfile时出现问题。

请看示例:

enter image description here

[用户故事]

正如您所见,架构是 CSV格式化平面文件

标记为绿色是客户lvl(细分),并且可以在输入文件中存在多次(无限制)。在客户群内部,我们会找到 CUST CUST_INF 记录,这些记录可以存在于第一案例中 min:1 max:1 情况 min:0 最大值:1

红色标记是发票lvl(段),可以在输入文件中存在几次(无界限)。在这段中我们会发现INV(min:1,max:1)和INV_INFO(min:0,max:1)和INV_LIN(min:1 max:unbounded)。

[问题]

如何为此案例创建有效架构?

INFO;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
INV;field_1;field_2;field_3;
INV_INF;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV;field_1;field_2;field_3;
INV_INF;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;

[更新2016年11月15日]

INFO;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
INV;field_1;field_2;field_3;
INV_INF;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV;field_1;field_2;field_3; <-- validation stop 

INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;

我已经从第二个INV段(此记录是可选的)中的输入文件中删除了 LIN_INF 记录(我的意思是空行),此时< strong>验证将停止在第二段的行末尾&#34; INV; field_1; field_2; field_3;&#34;。

[更新16.11.2016]

  

SCHEMA

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Test.FlatFileSchema1" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Test.FlatFileSchema1" 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="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" 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="infix" 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="INFO">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo tag_name="INFO;" structure="delimited" child_delimiter_type="char" child_delimiter=";" 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="Root_Child1_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_Child1_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_Child1_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:sequence minOccurs="1" maxOccurs="unbounded">
          <xs:annotation>
            <xs:appinfo>
              <groupInfo sequence_number="2" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
            </xs:appinfo>
          </xs:annotation>
          <xs:element minOccurs="1" maxOccurs="1" name="CUST">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="CUST;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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_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:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="CUST_INF">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="CUST_INF;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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_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:sequence>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:appinfo>
              <groupInfo sequence_number="3" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
            </xs:appinfo>
          </xs:annotation>
          <xs:element minOccurs="1" maxOccurs="1" name="INV">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="INV;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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_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" maxOccurs="1" name="INV_INF">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="INV_INF;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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:element name="Root_Child7_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" maxOccurs="unbounded" name="INV_LIN">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="INV_LIN;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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:element name="Root_Child8_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_Child8_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:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
  

示例数据

INFO;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
CUST;field_1;field_2;field_3;
CUST_INF;field_1;field_2;field_3;
INV;field_1;field_2;field_3;
INV_INF;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
INV_LIN;field_1;field_2;field_3;
  

错误

Error   1   Unexpected data found while looking for:
'INV_INF;'
'INV;'
The current definition being parsed is Root. The stream offset where the error occured is 359. The line number where the error occured is 12. The column where the error occured is 0.  C:\Users\Administrator\Desktop\test.txt 1   1   

1 个答案:

答案 0 :(得分:1)

  1. 使用“平面文件向导”。单击添加,新项目,平面文件架构向导,为架构命名,然后单击添加。点击下一步

  2. 选择实例文件(示例消息),然后单击下一步

  3. 在正在定义的记录上:/ Root只保留原样并单击“下一步”。

  4. 格式化,保留为By delimiter符号,然后单击Next

  5. 子分隔符:{CR} {LF}是正确的,因此请单击“下一步”。

  6. 将元素名称和元素类型更改为记录,重复记录或忽略(注意:我忽略除了每种类型的第一个实例以外的所有实例,请参见下文,并且我将CUST_INF标记为重复的一个所以我可以忽略以下几行)。单击“下一步”。

  7. enter image description here

    然后它要你定义每条记录。您必须为每条记录重复以下步骤

    1. 单击Next,Next,Next,将Child delimiter设置为;

    2. 点击记录有标签标识符,并输入该记录的标签,例如信息;单击Next(注意:我在标签中包含;否则它将其视为前缀分隔而不是后缀分隔记录,并且最终在每条记录的末尾都有一个空字段。)

    3. 设置元素名称和类型,单击“下一步”

    4. 重复上述步骤,直到完成所有记录并单击“完成”。

      现在您将拥有一个如下所示的基本架构。但是,由于我们必须按照以下步骤定义一些重复组,因此尚未验证。

      enter image description here

      1. 右键单击Root节点并添加一个序列组,通过输入*

      2. 将Max Occurs设置为无界限
      3. 剪切并经过CUST&amp; CUST_INF节点进入序列节点

      4. 更新CUST_INF以使Min出现0且Max出现1(1是可选的,因为默认值为1)

      5. 右键单击Root节点并添加一个序列组,通过输入*

      6. 将Max Occurs设置为无界限
      7. 剪切并通过INV,INV_INF&amp; INV_LIN进入第二个序列组

      8. 将INV_INF设置为Min发生0和Max发生1(1是可选的,因为默认值为1)

      9. 您的架构现在应该如下所示,并且能够解析您的平面文件。

        enter image description here

        <?xml version="1.0" encoding="utf-16"?>
        <xs:schema xmlns="http://Scratch.FlatFileSchema40595371w" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Scratch.FlatFileSchema40595371w" 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="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" 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="INFO">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:recordInfo tag_name="INFO;" structure="delimited" child_delimiter_type="char" child_delimiter=";" 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="INFO_Child1" type="xs:string">
                        <xs:annotation>
                          <xs:appinfo>
                            <b:fieldInfo justification="left" sequence_number="1" />
                          </xs:appinfo>
                        </xs:annotation>
                      </xs:element>
                      <xs:element name="INFO_Child2" type="xs:string">
                        <xs:annotation>
                          <xs:appinfo>
                            <b:fieldInfo justification="left" sequence_number="2" />
                          </xs:appinfo>
                        </xs:annotation>
                      </xs:element>
                      <xs:element name="INFO_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:sequence maxOccurs="unbounded">
                  <xs:annotation>
                    <xs:appinfo>
                      <groupInfo sequence_number="2" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                  <xs:element name="CUST">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo tag_name="CUST;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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="CUST_Child1" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="1" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="CUST_Child2" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="2" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="CUST_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" maxOccurs="1" name="CUST_INF">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo tag_name="CUST_INF;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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="CUST_INF_Child1" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="1" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="CUST_INF_Child2" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="2" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="CUST_INF_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:sequence>
                <xs:sequence>
                  <xs:annotation>
                    <xs:appinfo>
                      <groupInfo sequence_number="3" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                  <xs:element name="INV">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo tag_name="INV;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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="INV_Child1" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="1" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_Child2" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="2" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_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="INV_INF">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo tag_name="INV_INF;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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="INV_INF_Child1" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="1" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_INF_Child2" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="2" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_INF_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 maxOccurs="unbounded" name="INV_LIN">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo tag_name="INV_LIN;" structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="postfix" 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="INV_LIN_Child1" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="1" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_LIN_Child2" type="xs:string">
                          <xs:annotation>
                            <xs:appinfo>
                              <b:fieldInfo justification="left" sequence_number="2" />
                            </xs:appinfo>
                          </xs:annotation>
                        </xs:element>
                        <xs:element name="INV_LIN_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:sequence>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:schema>
        

        [更新2016年11月15日]

        如果你有类似的空白,只需添加一个选择节点,将INV_INF放在它下面,然后添加另一个没有Tag的记录,下面有一个字段,如下所示。如果CUST_INF也可以替换为空白,则对该节点执行相同操作。

        enter image description here