0

Biztalk を使用して UBL に変換する必要があるフラットファイルが必要です。

フラットファイルの最後に到達するまで、すべて問題ありません。

そのうちの一つはこんな感じ

RZ0100120400R;RZ01-00120400;RAZER MAMBA 2012 EL;2;739,77;2013.06.12
RZ0100580100R;RZ01-00580100;RAZER NAGA 2012;1;482,38;2013.06.12
RZ0400590100R;RZ04-00590100;RAZER TIAMAT EXPERT;2;605,3;2013.06.12

TOTA;L FAKTURAVÆRDI;EKSKL. MOMS;;18.667,30;

このような他のもの:

382908;382908;Anymode Samsung Gal;4;88,87;2013.06.13
382909;382909;Anymode Samsung Gal;4;88,87;2013.06.13
ANYMODESAMSUN;ANYMODE SAMSU;ANYMODE ANYMODE SAM;4;88,87;2013.06.13
;;;;;
TOTA;L FAKTURAVÆRDI;EKSKL. MOMS;;8.116,31;

一方のスキーマを作成すると、もう一方は機能しません。だから私の質問はです。問題なく両方を取得できるスキーマを作成するにはどうすればよいですか?? 最初の例の空行を調整する必要があるだけです。Visual Studio フラットファイル ウィザードを使用しています。

4

1 に答える 1

1

問題のレコード/行と、そのすべての子フィールド要素をオプションにすることができます (Min Occurs = 0)。

サンプル スキーマ (提供されている両方のサンプル フラット ファイルでテスト済み...):

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://SampleProject.FlatFileSchema1" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://SampleProject.FlatFileSchema1" 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="infix" 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:element minOccurs="0" maxOccurs="unbounded" name="line">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter=";" child_order="infix" 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:element minOccurs="0" name="Child1" 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="Child2" 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="Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element minOccurs="0" name="Child4" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="4" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element minOccurs="0" name="Child5" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="5" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element minOccurs="0" name="Child6" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" sequence_number="6" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

それが役立つことを願っています!

よろしく
フィリップ

于 2013-07-26T08:44:36.230 に答える