Biztalk 为输出文件创建架构

Biztalk 为输出文件创建架构,biztalk,biztalk-2013,Biztalk,Biztalk 2013,我正在尝试创建一个输出文件模式,其格式如下 MEMBER,1,134,134,Jo, ,Arch,1,S,M BENEFIT,1,M,1,89,7,1,1,20110101,20120731,11 BENEFIT,1,D,2,89,3,11,5,20110101,20120731,16 MEMBER,14,448,448,Cli,M,Ast,1,M,M BENEFIT,14,D,2,89,3,11,5,20170101,17000101,16 BENEFIT,14,M,1,89,7,1,1,20

我正在尝试创建一个输出文件模式,其格式如下

MEMBER,1,134,134,Jo, ,Arch,1,S,M
BENEFIT,1,M,1,89,7,1,1,20110101,20120731,11
BENEFIT,1,D,2,89,3,11,5,20110101,20120731,16
MEMBER,14,448,448,Cli,M,Ast,1,M,M
BENEFIT,14,D,2,89,3,11,5,20170101,17000101,16
BENEFIT,14,M,1,89,7,1,1,20170101,17000101,11
BENEFIT,14,M,1,89,7,1,1,20150101,20161231,11
因此,在平面文件模式中,我应该创建两个记录,一个用于成员(一个作为最大发生次数),另一个用于收益(最大发生次数为无界次数)?


我做得对吗

您的输入XML消息是否包含多个成员

如果是这样,您将希望添加一个序列组,其最大发生次数设置为最大成员数或无界。然后是,成员=1,福利无限

此外,您还应该在Member和Benefit中分别使用标记标识符设置为Member和Benefit,这样,如果必须使用模式解析文件,您就可以成功地进行解析

参考模式

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Scratch.41367483" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Scratch.41367483" 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:sequence maxOccurs="unbounded">
          <xs:annotation>
            <xs:appinfo>
              <groupInfo sequence_number="1" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
            </xs:appinfo>
          </xs:annotation>
          <xs:element name="Member">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="MEMBER" structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
              </xs:appinfo>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:annotation>
                  <xs:appinfo>
                    <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:element name="EMPLOYEE_ID_01" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="1" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Subscriber_ID" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="2" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="PrimaryID" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="3" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="F_Name" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="4" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="M_Initial" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="5" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="L_Name" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="6" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="R_Code" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="7" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Marital" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="8" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Gender" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <fieldInfo sequence_number="9" justification="left" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element maxOccurs="unbounded" name="Benefit">
            <xs:annotation>
              <xs:appinfo>
                <b:recordInfo tag_name="BENEFIT" structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="prefix" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="2" />
              </xs:appinfo>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:annotation>
                  <xs:appinfo>
                    <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:element name="EMPPLOYEE_ID_02" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="1" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="L_Code" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="2" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="E_Number" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="3" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="C_Number" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="4" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Suffix" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="5" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Account" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="6" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Plan_ID" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <fieldInfo justification="left" sequence_number="7" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="E_Date" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="8" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="T_Date" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <fieldInfo justification="left" sequence_number="9" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
                <xs:element name="C_O" type="xs:string">
                  <xs:annotation>
                    <xs:appinfo>
                      <b:fieldInfo justification="left" sequence_number="10" />
                    </xs:appinfo>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


注意:如果确实使用标记标识符,则必须将子顺序更改为前缀,或者在标记标识符中包含第一个coma并将其保持为中缀。

您的成员节点看起来不像只发生一次,而是应该将福利定义为成员记录的子记录,并且福利和成员都具有maxOccurse=unbounded。