如何在将BizTalk平面文件解析器设置为complex的情况下从左到右解析可选字段? [英] How to parse optional fields from left to right with BizTalk flat file parser set to complex?

查看:85
本文介绍了如何在将BizTalk平面文件解析器设置为complex的情况下从左到右解析可选字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在BizTalk 2013中开发用于平面文件反汇编的架构.但是,由于解析结果很垃圾,因此该架构存在很大问题. 我正在解析的平面文件类型如下:

I am developing a schema for flat file disassembly in BizTalk 2013. However, I have a big problem with the schema, since the parsing result is rubbish. The flat file type I am parsing looks like this:

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'

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

The flat file has three hierarchy parts:

顶级:,以'个字符分隔(不是换行符,仅为了提高可读性而添加了该字符)

Top level: Segments, delimited by ' characters (not the line break, this was just added for better readability)

中级:字段,以+字符分隔.可以直接包含一个值或一组值(请参见最低级别)

Middle level: Fields, delimited by + characters. May directly contain a value or a group of values (see bottom level)

最底层:属性,由:字符

由于 TAG?-段是部分可选的,并且可能以多个顺序出现,因此我将parser_optimization ="complexity"选项与lookahead_depth ="0"一起使用,并使用 TAG ?-用于标识段类型的名称,我正在使用它来解析所有内容. 除段为child_order ="postfix"外,所有定界符均为child_order ="infix".

Since the TAG?-Segments are partially optional and may occur in multiple orders, I am using the parser_optimization="complexity" option along with lookahead_depth="0" and use the TAG?-Name to identify the segment types, I am using to parse everything. All delimiters are of child_order="infix" except the segments, which are child_order="postfix".

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

Some Segments, fields and attributes are required, most are not. However, the first field and its attributes (tag name, ...) is always required. The separation and identification of segments works fine, fields also are working correctly. However, when I am having optional fields containing a group of optional attributes, the schema does not get parsed correctly. Example: Syntax:

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

所有 a?属性都是可选的

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

The attribute values are being put into the correct XML fields while parsing a segment like this:

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

但是,由于平面文件规范允许省略可选字段,因此消息也可能看起来像这样:

However, since the flat file specification allows optional fields to be left out, the message may also look like this:

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

在这种情况下,值不会像应有的那样放入第二和第三XML字段,而是放入第三和第四.根据我在该段中包含的:的数量,也可以填写第一个和第六个或第二个和第四个XML字段.

In this case, the values are not being put into the second and third XML field like they should be but are put into the third and fourth. Depending on the amount of : signs I include into the segment, also the first and sixth or second and fourth XML field may be filled.

我需要平面文件解析器从左到右填充这些字段,而不是现在使用的混乱方式.但是,切换到parser_optimization ="speed"并不是一种选择,因为其余的架构太复杂了(除非有一种在本地进行的方法).

I would need the flat file parser to fill these fields form the left to the right instead of the chaotic way it is using now. However, switching to parser_optimization="speed" is not an option since the rest of the schema is too complex (unless, there is a way to do that locally).

这些是XSD架构中用于解析此类字段的部分(由于架构很大,因此仅提取部分)

These are the parts of the XSD schema that are being used for parsing such a field (only the extracted parts, since the schema is very big)

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

Common parts definition (gets included in the schema itself, is being used by other schemas as well, in this example it is a 4 part Attribute group):

<?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>

推荐答案

您的特定摘录缺少SEG_HEAD_REF1_TYPE的定义,并且还有其他问题,当我尝试生成实例时,出现自定义组件调用失败"的信息.但是,我根据您的平面文件模拟示例创建了一个平面文件架构,该示例可以正确解析该示例以及下面的示例. (注意:我必须从架构中删除缩进,否则缩进太大了.)

Your Specific Extract is missing a definition for SEG_HEAD_REF1_TYPE and there were other issues as well that when I tried to generate an instance I got "Custom component invocation failed." However I created a flat file schema based on your flat file mock sample that parses that as well as the sample below correctly. (Note: I had to remove indenting from the schema otherwise it would be too large to post).

<?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'

这篇关于如何在将BizTalk平面文件解析器设置为complex的情况下从左到右解析可选字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆