BizTalk FlatFile架构多个不规则重复记录 [英] BizTalk FlatFile Schema multiple irregular repeating records

查看:72
本文介绍了BizTalk FlatFile架构多个不规则重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下示例数据来映射模式.数据集描述如下:

I try to map a schema using the following sample data. The dataset is described as follows:

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

currency
date
record ID
quantity
amount
narratives
blank line

我遇到的问题是

    叙述的内容各不相同;
  1. 没有标记不能用于货币.
  1. the line of narratives varies;
  2. no tag cannot be used for currency.

美元
090115
990282.00499.03363
1
4.88
NOS中有2个项目

USD
090115
990282.00499.03363
1
4.88
2 items in NOS

EUR
090115
990282.00499.03363
3
7.48
CVS中有1个项目
NOS中有4个项目

EUR
090115
990282.00499.03363
3
7.48
1 items in CVS
4 items in NOS

推荐答案

我能够通过创建"MainRecord"来为您的文档创建架构,该文件的父级有两个CRLF的分隔符.然后,这具有您各行的子元素,最后一行本身就是由CRLF分隔的记录.

I was able to create a schema for your document by creating a "MainRecord", whose parent has a delimiter of two CRLFs. This then has the child elements of your individual lines, the last one of which is itself a record that is delimited by CRLF.

请注意,我已在Visual Studio中对此进行了验证,但未在实际的BizTalk应用程序中进行了验证-可能需要进行一些其他调整才能完全正常运行,但这应该使您朝着正确设置模式的正确方向前进中风.

Note that I validated this in Visual Studio, but not in an actual BizTalk application - probably would require some additional tweaks to get fully operational, but this should get you going in the right direction of how to set up the schema in broad strokes.

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

这篇关于BizTalk FlatFile架构多个不规则重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆