为OutPut文件创建架构

时间:2016-12-28 18:09:37

标签: 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,20170101,17000101,11
BENEFIT,14,M,1,89,7,1,1,20150101,20161231,11

所以在Flat File架构中,我应该为Member创建一个记录(其中一个为Max Occur),One为Benefit(最大值出现在无界)? enter image description here

我做得对吗

1 个答案:

答案 0 :(得分:0)

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

如果是这样,您将要添加一个序列组,其中Max Occurs设置为最大成员数或Unbounded。然后是,会员= 1,福利无限制。

Repeating Sequence Schema

此外,您应该在Member和Benefit中分别使用标记标识符设置为MEMBER和BENEFIT,因此如果您必须使用模式来解析文件,则可以成功完成。

enter image description here

架构供参考

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

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