是否有使用 .NET 的转换引擎或库?
我们正在寻找一个可以读取任何输入(EDIfact 文件、CSV、XML 等内容)的转换库或引擎。因此,包含必须转换为已知业务对象结构的数据的文件(或 Web 服务结果)。)应使用自定义规则将数据转换为现有业务对象。 XSLT 既复杂(难以学习)又简单(功能不够)
有人能推荐一个 C# 库或引擎吗? 我已经见过 Altova MapForce,但希望我可以将一些东西发送给数十个人,他们将构建/设计自己的转换,而无需支付数十个 Altova 许可证。
We're looking for a Transformation library or engine which can read any input (EDIfact files, CSV, XML, stuff like that. So files (or webservices results) that contain data which must be transformed to a known business object structure.) This data should be transformed this to a existing business object using custom rules. XSLT is both to complex (to learn) and to simple (not enough features)
Can anybody recommend a C# library or engine? I have seen Altova MapForce but would like something I can send out to dozens of people who will build / design their own transformations without having to pay dozens of Altova licenses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您认为 XSLT 对您来说太难,我认为您可以尝试使用 LINQ to XML 来解析 XML 文件。 它集成在 .NET 框架中,您可以使用 C#(或者,如果您使用 VB.NET 9.0,则更好,因为 XML 文字)而不是学习其他语言。 您可以轻松地将其与现有应用程序集成,并且不会出现 XSLT 所出现的语言与文件管理之间的范式不匹配的情况。
Microsoft LINQ to XML
当然,它不是一个解析文件的框架或库,但 XSLT 都不是,所以...
If you think that XSLT is too difficult for you, I think you can try LINQ to XML for parsing XML files. It is integrated in the .NET framework, and you can use C# (or, if you use VB.NET 9.0, better because of the XML literals) instead of learning another language. You can integrate it with the existing application without much effort and withouth the paradigm mismatch between the language and the file management that occurs with XSLT.
Microsoft LINQ to XML
Sure, it's not a framework or library for parsing files, but neither XSLT is, so...
DataDirect Technologies 的产品正是能做到这一点。
在 http://www.xmlconverters.com/ 有一个名为 XmlConverters 的库,它可以将 EDI 转换为 XML,反之亦然。 还有 CSV、JSON 和其他格式的转换器。
这些库可作为 100% .net 托管代码和 100% Java 并行端口使用。
.net端支持XmlReader和XmlWriter,而Java端支持SAX、StAX和DOM。 两者还支持流和读取器/写入器 I/O。
DataDirect 还有一个针对将关系数据与 EDI 和 XML 合并而优化的 XQuery 引擎,但它只是 Java。
DataDirect Technologies has a product that does exactly this.
At http://www.xmlconverters.com/ there is a library called XmlConverters which converts EDI to XML and vice-versa. There are also converters for CSV, JSON, and other formats.
The libraries are available as 100% .net managed code, and a parallel port in 100% Java.
The .net side supports XmlReader and XmlWriter, while the Java side supports SAX, StAX and DOM. Both also support stream and reader/writer I/O.
DataDirect also has an XQuery engine optimized for merging relational data with EDI and XML, but it is Java only.
Microsoft BizTalk Server 在这方面做得非常好。
Microsoft BizTalk Server does a very good job of this.
XSLT 不适用于 EDI 和 CSV。 如果您想要一个完全通用的转换引擎,您可能需要花一些钱。 我使用 Symphonia 来处理 EDI,它有效,但它不是免费的。
问题是你所描述的问题听起来很“企业”(我确信没有人使用 EDI 来娱乐),所以没有开源/免费工具来处理这些东西。
XSLT is not going to work for EDI and CSV. If you want a completely generic transformation engine, you might have to shell out some cash. I have used Symphonia for dealing with EDI, and it worked, but it is not free.
The thing is the problem you are describing sounds "enterprisey" (I am sure nobody uses EDI for fun), so there's no open source/free tooling for dealing with this stuff.
我不会这么快就认为 XSLT 太复杂或不包含您需要的功能而忽略它。
有很多书籍/网站描述了您需要了解的有关 XSLT 的所有信息。 是的,有一点学习曲线,但不需要太多时间就能进入,如果您需要帮助,总有一个像 stackoverflow 这样的优秀社区可以求助;-)
至于缺乏功能,您可以随时扩展 xslt并使用 xslt 调用 .NET 程序集
XsltArgumentList.AddExtensionObject() 方法,这将为您提供所需的功能。
MSDN 有一个很好的例子这里< /a>
确实,MapForce 和 Biztalk 应用程序使创建 xslt 变得非常容易,但它们也花费了一点钱。 另外,根据您的用户群(假设非开发人员),我认为您会发现这些应用程序有自己的学习曲线,并且通常功能过于丰富,无法满足您的需求。
我建议您考虑根据您的用户需求构建和分发您自己的自定义映射工具。
另外,如果您需要一个库来协助文件转换,我建议您使用 SourceForge 的 FileHelpers
I wouldn't be so quick to dismiss XSLT as being too complex or not contain the features you require.
There are plenty of books/websites out there that describe everything you need to know about XSLT. Yes, there is a bit of a learning curve but it doesn't take much to get into it, and there's always a great community like stackoverflow to turn to if you need help ;-)
As for lack of features you can always extend xslt and call .NET assemblies from the xslt using the
XsltArgumentList.AddExtensionObject() method, which would give you the power you need.
MSDN has a great example of using this here
It's true that the MapForce and Biztalk applications make creating xslt very easy but they also cost a bit. Also, depending on your user base (assuming non developers), I think you'll find that these applications have there own learning curves and are often too feature rich for what you need.
I'd recommend you to consider building and distributing your own custom mapping tool specific to your users needs.
Also if you need a library to assist with file conversions I'd recommend FileHelpers at SourceForge