如何从左到右解析可选字段,并将BizTalk平面文件解析器设置为复杂?

时间:2014-02-24 14:34:54

标签: xml parsing xsd biztalk biztalk-2013

我正在为BizTalk 2013中的平面文件反汇编开发一个模式。但是,我对模式有一个很大的问题,因为解析结果是垃圾。 我正在解析的平面文件类型如下所示:

HEADER:opt1:opt2:opt3+opt4:opt5+opt6+op7:opt8:opt9'
TAG1:opt1:opt2:opt3+opt4:opt5:opt6+op7:opt8:opt9'
TAG2:opt1:opt2:opt3+opt4:opt5:opt6+op7:opt8:opt9'
TAG3:opt1:opt2:opt3+opt4++opt6+op7:opt8:opt9'
TAG4:opt1:opt2:opt3+opt4:opt5'

平面文件有三个层次结构部分:

顶级:细分,由'字符分隔(不是换行符,只是为了更好的可读性而添加)

中级:字段,由+字符分隔。可以直接包含一个值或一组值(参见底层)

底层:属性,由:字符

分隔

由于 TAG? -Segments是部分可选的并且可能以多个顺序发生,我使用parser_optimization =“complexity”选项以及lookahead_depth =“0”并使用 TAG ? -Name来标识段类型,我用来解析所有内容。 所有分隔符都是child_order =“infix”,除了段是child_order =“postfix”。

某些细分,字段和属性是必需的,大部分都不是。但是,始终需要第一个字段及其属性(标记名称,...)。 段的分离和识别工作正常,字段也正常工作。但是,当我有包含一组可选属性的可选字段时,架构无法正确解析。 例: 语法:

TAGX:opt1:opt2:opt3+a1:a2:a3:a4:a5:a6'

所有 a?属性都是可选的

在解析像这样的片段时,属性值被放入正确的XML字段中:

TAGX:1:2:3+:1:2:::'

但是,由于平面文件规范允许省略可选字段,因此消息也可能如下所示:

TAGX:1:2:3+:1:2'

在这种情况下,值不会像它们应该放在第二个和第三个XML字段中,而是放在第三个和第四个字段中。根据我在段中包含的符号数量,也可以填充第一个和第六个,第二个和第四个XML字段。

我需要平面文件解析器从左到右填充这些字段,而不是现在使用的混乱方式。但是,切换到parser_optimization =“speed”不是一个选项,因为架构的其余部分太复杂(除非有办法在本地执行此操作)。

这些是用于解析此类字段的XSD架构的一部分(仅提取的部分,因为架构非常大)

公共部件定义(包含在模式本身中,也被其他模式使用,在本例中它是4部分属性组):

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <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 root_reference="SEG_HEAD" pad_char_type="none" 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" standard="Flat File" default_pad_char=" "/>
        </xs:appinfo>
    </xs:annotation>

    <xs:element name="MATERIAL_TYPE" type="MATERIAL_TYPE">
        <xs:annotation>
            <xs:appinfo>
                <b:recordInfo sequence_number="4" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="char" child_delimiter=":" escape_char_type="char" escape_char="?" child_order="infix"/>
            </xs:appinfo>
        </xs:annotation>
    </xs:element>
    <xs:complexType name="MATERIAL_TYPE">
        <xs:sequence>
            <xs:annotation>
                <xs:appinfo>
                    <b:groupInfo sequence_number="0"/>
                </xs:appinfo>
            </xs:annotation>
            <xs:element name="NUMBER_SYSTEM" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo sequence_number="1" justification="left"/>
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
            <xs:element name="MATERIAL" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo sequence_number="2" justification="left"/>
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
            <xs:element name="EAN" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo sequence_number="3" justification="left"/>
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
            <xs:element name="BUYERARTICLENUMBER" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo sequence_number="4" justification="left"/>
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

特定架构提取:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://example.com/namespace" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation=".\COMMON_SChema_v2.0.xsd"/>
    <xs:annotation>
        <xs:appinfo>
            <b:schemaInfo standard="Flat File" root_reference="SEG_ORDER" pad_char_type="none" count_positions_by_byte="false" parser_optimization="complexity" lookahead_depth="0" suppress_empty_nodes="true" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" default_pad_char=" " escape_char_type="char" default_escape_char="?" default_child_order="infix"/>
            <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions"/>
        </xs:appinfo>
    </xs:annotation>
    <xs:element name="SEG_ORDER">
        <xs:annotation>
            <xs:appinfo>
                <b:recordInfo structure="delimited" child_order="postfix" escape_char_type="char" escape_char="?" sequence_number="17" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="char" child_delimiter="'"/>
            </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:annotation>
                    <xs:appinfo>
                        <b:groupInfo sequence_number="0"/>
                    </xs:appinfo>
                </xs:annotation>

                <xs:element name="TAGX" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:appinfo>
                            <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="+" child_order="infix" escape_char_type="char" escape_char="?" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="6" tag_name="TAGX"/>
                        </xs:appinfo>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:annotation>
                                <xs:appinfo>
                                    <b:groupInfo sequence_number="0"/>
                                </xs:appinfo>
                            </xs:annotation>
                            <xs:element name="SEG_HEAD" type="SEG_HEAD_REF1_TYPE">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter=":" escape_char_type="char" escape_char="?" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="POSITION_NUMBER">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter=":" child_order="infix" escape_char_type="char" escape_char="?" 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>
                                                <b:groupInfo sequence_number="0"/>
                                            </xs:appinfo>
                                        </xs:annotation>
                                        <xs:element name="NUMBER" 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="MATERIAL" type="MATERIAL_TYPE" minOccurs="0" maxOccurs="1">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter=":" child_order="infix" escape_char_type="char" escape_char="?" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

1 个答案:

答案 0 :(得分:0)

您的特定提取缺少SEG_HEAD_REF1_TYPE的定义,还有其他问题,当我尝试生成实例时,我得到“自定义组件调用失败”。但是,我根据您的平面文件模拟样本创建了一个平面文件架构,该样本可以正确解析以下示例。 (注意:我不得不从架构中删除缩进,否则它太大而无法发布)。

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Scratch.FlatFileSchema2" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Scratch.FlatFileSchema2" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo standard="Flat File" root_reference="Root" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_order="postfix" child_delimiter_type="char" child_delimiter="'" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Header">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="1" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="HEADER" child_order="infix" child_delimiter_type="char" child_delimiter="+" escape_char_type="char" escape_char="?" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Field1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="1" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix" child_delimiter_type="char" child_delimiter=":" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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:complexType>
</xs:element>
<xs:element name="TAG1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="2" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="TAG1" child_order="infix" child_delimiter_type="char" child_delimiter="+" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Field1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix" child_delimiter_type="char" child_delimiter=":" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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:complexType>
</xs:element>
<xs:element name="TAG2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="TAG2" child_order="infix" child_delimiter_type="char" child_delimiter="+" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Field1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix" child_delimiter_type="char" child_delimiter=":" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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:complexType>
</xs:element>
<xs:element name="TAG3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="TAG3" child_order="infix" child_delimiter_type="char" child_delimiter="+" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Field1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix" child_delimiter_type="char" child_delimiter=":" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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:complexType>
</xs:element>
<xs:element name="TAG4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" tag_name="TAG4" child_order="infix" child_delimiter_type="char" child_delimiter="+" sequence_number="5" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Field1">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="prefix" child_delimiter_type="char" child_delimiter=":" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field2">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field3">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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="Field4">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_order="infix" child_delimiter_type="char" child_delimiter=":" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" name="Attr1" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr2" type="xs:string">
<xs:annotation>
<xs:appinfo>
  <b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="Attr3" 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:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

样品

HEADER:opt1'TAG1:opt1'TAG2:opt1'TAG3:opt1'TAG4:opt1'