【问题标题】:BizTalk FlatFile Schema multiple irregular repeating recordsBizTalk FlatFile Schema 多个不规则重复记录
【发布时间】:2015-12-29 14:14:30
【问题描述】:

我尝试使用以下示例数据映射架构。数据集描述如下:

货币
日期
记录ID
数量
金额
叙述
空行

我遇到的问题是

  1. 叙事路线各不相同;
  2. 没有标签不能用于货币。

美元
090115
990282.00499.03363
1
4.88
NOS 中的 2 项

欧元
090115
990282.00499.03363
3
7.48
CVS 中有 1 项
NOS 中的 4 项

【问题讨论】:

    标签: biztalk biztalk-2013


    【解决方案1】:

    我能够通过创建“MainRecord”为您的文档创建架构,其父级具有两个 CRLF 的分隔符。然后,这包含您的各个行的子元素,其中最后一个本身就是由 CRLF 分隔的记录。

    请注意,我在 Visual Studio 中验证了这一点,但没有在实际的 BizTalk 应用程序中进行验证 - 可能需要一些额外的调整才能完全运行,但这应该让您朝着正确的方向前进,即如何广泛地设置架构笔画。

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns="http://BizTalk_Server_Project1.FlatFileSchema2" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://BizTalk_Server_Project1.FlatFileSchema2" 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 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 maxOccurs="unbounded" name="MainRecord">
              <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 name="Currency" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="1" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Date" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="2" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="RecordId" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="3" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Quantity" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="4" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="Amount" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="5" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element maxOccurs="unbounded" name="Narratives">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="infix" sequence_number="6" 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 name="Narrative" 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:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    

    【讨论】:

    • Dan,您使用双 CRLF 的绝妙想法轻松解决了我的问题。非常感谢你。新年快乐。
    • 很高兴听到这个消息。如果答案解决了您的问题,请考虑将答案标记为已接受(投票摇杆下方的复选框)。
    猜你喜欢
    • 1970-01-01
    • 2011-01-15
    • 2015-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-02
    • 1970-01-01
    相关资源
    最近更新 更多