从 XSD 生成 Ruby 类 [英] Generate Ruby Classes from XSD

查看:41
本文介绍了从 XSD 生成 Ruby 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从 XSD 生成 Ruby 类(甚至可能是 ActiveResource 类),以便它们包含一种将类序列化为对初始 XSD 有效的 xml 的方法?

Is there a way to generate Ruby classes (maybe even ActiveResource classes) from an XSD so that they contain a way to serialize the classes to xml valid for the initial XSD?

我知道soap4r 有xsd2ruby,但生成的ruby 类似乎不能轻易序列化为xml.

I know that soap4r has xsd2ruby but it appears that the generated ruby classes cannot be easily serialized to xml.

推荐答案

无耻的自我宣传(希望这在 stackoverflow 上没问题)但我正在开发一个开源项目,只做 那个

Shameless self promotion (hope this is okay on stackoverflow) but I'm working on an open source project to do just that

它仍在进行中(可以随意发送补丁),但最终目标是将 XSD 转换为/从 Ruby 类(现在已经这样做)并将符合该 XSD 的 XML 转换为/从这些类的实例.

Its still a work in progress (feel free to send patches) but the ultimate goal is to convert XSD to/from Ruby classes (which it does now) and convert XML conforming to that XSD to/from instances of those classes.

这篇关于从 XSD 生成 Ruby 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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