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

BTS flat file schema generate with unbounded max records inside

我在 Visual studio 中使用 BTS 开发工具将输入文档作为平面文件的 generate/create 架构有问题。

请看例子:

[用户故事]

如您所见,架构是一个 CSV 格式的平面文件

green 上标记的是客户 lvl(细分)并且可以在输入文件中存在几次(无限制)。在此 customer segment 中,我们将找到 CUSTCUST_INF 记录,这些记录可以存在于 first case min : 1, max: 1second case min: 0, max: 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;

我已经从 second INV 段 中的输入文档中删除了 LIN_INF 记录(我的意思也是空行)(此记录是可选的),此时 validationstop 在第二段 "INV;field_1;field_2;field_3;".[=19= 的行尾]

[2016 年 11 月 16 日更新]

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>

EXAMPLE DATA

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;

ERRORS

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. 使用平面文件向导。添加、新项目、平面文件架构向导,为架构命名并单击添加。点击下一步

  2. Select 实例文件(示例消息)并单击下一步

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

  4. 格式,保留为By delimiter symbol 然后点击Next

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

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

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

  1. 点击下一步,下一步,下一步,设置子分隔符为;

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

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

重复上述步骤,直到完成所有记录,然后单击完成。

现在您将拥有如下所示的基本架构。但是,这还不能验证,因为我们必须按照以下步骤定义一些重复组。

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

  2. 将 Max Occurs 设置为 unbounded
  3. 剪切并通过 CUST & CUST_INF 节点进入序列节点

  4. 更新 CUST_INF 使其出现最小次数 0 和最大次数 1(1 是可选的,因为默认值为 1)

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

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

  8. 将INV_INF设置为最少出现0次,最多出现1次(1是可选的,默认为1)

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

<?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 放在它下面,然后添加另一条没有标签和一个字段的记录,如下所示。如果CUST_INF也可以用空格代替,那么对那个节点做同样的事情。