2016-12-28 103 views
0

我想創建這應該是下面格式的輸出文件架構的模式。創建輸出文件

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 

所以在平面文件架構,我應該創建兩個記錄一個成員(其中一個爲最大地發生),一個用於福利(最大值發生無界)? enter image description here

我這樣做是正確的

+0

你的會員節點看起來並不像只出現一次,它看起來像你應確定受益,因爲您的會員記錄的子記錄,並同時受益和會員有maxOccur =無限。 – Zee

回答

0

請問您輸入XML消息包含多個會員?

如果是這樣你會想添加一個序列組與最高時設置爲成員或無界的最大數量。然後是的,Member = 1和Benefit無界限。

Repeating Sequence Schema

會員和利益也應該使用標籤標識分別設置爲會員和利益,所以如果你有使用模式來解析文件,你可以做得很成功。

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> 

注:如果您使用標籤標識,你將不得不子訂單更改爲前綴,或者包括標籤識別符的第一個昏迷,並保持它是中綴。