平面文件架构问题 [英] flat file schema issue

查看:88
本文介绍了平面文件架构问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法为传入的位置平面文件开发工作架构。这应该是一个非常简单的架构,但我认为我错过了一些简单的东西。传入记录可能如下所示:

I'm having trouble developing a working schema for an incoming positional flat file. It should be a pretty easy schema to develop, but I think I'm missing something simple. The incoming record can look like this:

000189373567368238456(标题,行类型'0001',仅在文件中出现一次)

000189373567368238456(header,  line type '0001', occurs only once in file)

000283364564568( line 类型'0002',新记录的开头,每个记录只发生一次)

000283364564568( line type '0002', beginning of new record, occurs only once per record)

000398947856848967(行 类型'0003',每个记录可以无限重复)

000398947856848967(line type '0003', can repeat infinitely per record)

00038467936735676(行 类型'0003',每个记录可以无限重复)

00038467936735676(line type '0003', can repeat infinitely per record)

000393568895367(行 类型'0003',每个记录可以无限重复)

000393568895367(line type '0003', can repeat infinitely per record)

000489254267488884(行 类型'0004',每个记录只能出现一次)

000489254267488884(line type '0004', can occur only once per record)

0002674565467345689(行 类型'0002',新记录的开头,仅发生每条记录一次)

0002674565467345689( line type '0002', beginning of new record, occurs only once per record)

0003812735673567(行 类型'0003',每条记录可无限重复)

0003812735673567(line type '0003', can repeat infinitely per record)

0003835683783567356(行 类型'0003',每个记录可以无限重复)

0003835683783567356(line type '0003', can repeat infinitely per record)

0004935646735673(行 类型'0004',每个记录只能出现一次)

0004935646735673(line type '0004', can occur only once per record)

00078995675368478(行 类型'0007',页脚,只能在文件中出现一次)

00078995675368478(line type '0007', Footer, can occur only once in file)

因此,传入的文件是实际上,我必须将数据映射到传出的edi 835.实际记录由三种线路类型(0002,0003,0004)组成,当然我每个文件可以有多个记录。 

So, the incoming file is actually data that I have to map to an outgoing edi 835. The actual record is made up of three line types (0002, 0003, 0004), and of course I can have multiple records per file. 

我可以使用一行的前四个字符作为确定行类型的标记。线条实际上很长。我非常接近获得一个有效的架构。如果我删除一个看起来像这样的文件,它只包含一个带有多个类型'0003'
行的记录,它可以工作:

I'm able to use the first four chars of a line as the tag for determining line type. The lines are actually quite long. I'm very close on getting a working schema. If I drop a file that looks like this, which contains only one record with multiple type '0003' lines, it works:

0001

0002

0003

0003

0003

0004

0007

但是,当我尝试删除包含多个记录的文件时,我遇到了问题,如下所示:

However, I'm experiencing issues when I try to drop a file containing multiple records, like this:

0001

0002

0003

0003

0004

0002

0003

0003

0004

0007

如果我删除这样的文件,我会看到以下错误:

If I drop a file like this I am seeing the following error:

因此,它会读取第一个记录正常,但很难意识到实际的"记录"由2,3和4行组成......并且记录可以重复。 

So, it will read the first record fine, but has trouble realizing that the actual 'record' is made up of line types 2,3 and 4...and that the record can repeat. 

这里是我的sch的截图ema:

here is a screenshot of my schema:

每一行都设置为子记录。第1行(标题)和第7行(页脚)的最大发生次数设置为"1"。线型2,3和4的最大发生次数被设置为无限制,即使第2和第4行仅在每条记录中出现一次。

Each line is set up as a Child Record. The Max Occurs for line types 1(header) and 7(footer) are set to '1'. The Max Occurs for line types 2,3 and 4 are set to unbounded, even though line types 2 and 4 will only occurs once per record.

欢迎任何建议。

谢谢!

推荐答案

任何重复的群体都必须在单个父元素下。

Any groups that repeat have to be under a single parent element.

因此,模式看起来像:

HEADER

- > EOBInformations&NBSP;&NBSP;&NBSP;&NBSP; < -Container为每个0002重复

->EOBInformations     <-Container repeates for every 0002

- > EOB_INFO

-->EOB_INFO

---> ServiceLines      &NBSP;&NBSP;&NBSP; < -Container重复每一个0003

--->ServiceLines         <-Container repeates for every 0003

----> SERVICE-LINE

---->SERVICE-LINE

---> TOTALS

--->TOTALS

FOOTER


这篇关于平面文件架构问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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