简体   繁体   English

平面文件到XML单元测试>如果平面文件中的一个节点失败,如何处理其余节点

[英]Flat file to XML Unit Test > How do I process remaining nodes if one fails within the flat file

I am wondering if within biztalk there is a way of processing xml from a flat file with incorrect nodes within the flat file. 我想知道biztalk中是否有一种方法可以处理平面文件中带有错误节点的平面文件中的xml。 for example, 例如,

Row 1 and 2 are correct, they will proceed to disassemble to xml. 第1行和第2行是正确的,它们将继续反汇编为xml。 Row 3 however is invalid. 但是,第3行无效。 this is not transformed. 这没有改变。 Row 4 and onwards then is ignored by the pipeline and row 1 and 2 are processed into a valid xml document. 第4行及以后的行将被管道忽略,第1行和第2行将处理为有效的xml文档。

I have tried using Recoverable Interchange Processing however I believe this is only for multi part messages. 我尝试使用可恢复的交换处理,但是我相信这仅适用于多部分邮件。

Is there a way to process the rest of the flat file even though somewhere there's a chance the flat file has a row what doesn't conform to the schema? 即使某个地方的平面文件中有一行不符合架构的行,有没有办法处理其余的平面文件?

No, the Flat File Pipeline Component will always fail after the first error. 不,平面文件管道组件将始终在出现第一个错误后失败。 The XmlValidator Pipeline Component fails the same way. XmlValidator管道组件以相同的方式失败。

However you could write your own Flat File Pipeline Component that would continue to parse and find further errors. 但是,您可以编写自己的平面文件管道组件,该组件将继续解析并查找更多错误。

This has been done with the XMLValidator , but I've never come across anyone that has done this particular feature with the Flat File Pipeline Component, probably because with a flat file structure, some failures would just cause further parsing to be useless as it would not know what structure it should try parsing next eg a missing row delimiter. 这是通过XMLValidator完成的,但是我从来没有遇到过使用Flat File Pipeline Component完成此特定功能的人,这可能是因为使用Flat File结构时,某些故障只会导致进一步的解析变得毫无用处不知道下一步应尝试解析的结构,例如缺少行分隔符。

There are various examples of Extending the Flat File Component for other features however. 但是,存在各种扩展平面文件组件以实现其他功能的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM