我可以从 XSD 生成用于 XML 序列化/反序列化的动作脚本类吗?
我一直在 StackOverflow 和其他网站上查看各种问题,但我还没有看到一个库可以 a) 生成给定 XSD 的动作脚本代码 b) 使用生成的类对 XML 进行序列化和反序列化。
在 Java 世界中,这就是 JAXB。我有一组大型 XSD,Web 服务基于这些 XSD 生成 XML 输出。我不想手动编写动作脚本类,那将是一项艰巨的工作。
在 ActionScript 中拥有源代码会有很大帮助,因为与拥有类似代理的类相比,基于 xml/json 到对象的运行时绑定编写代码更容易出错。有什么想法吗?
更新:我在 Adobe 的 Flash Builder 中找到了一个向导来完成我一直在寻找的事情,但不幸的是,它因我抱怨实体和服务名称等的大小写敏感性而失效。所以可以做到这一点的第 3 方框架是仍然需要。
I've been looking at various questions in StackOverflow and in other sites, but I have not seen a library that
a) generates actionscript code given XSD
b) serializes to and deserializes from XML using the generated classes.
In Java world this is JAXB. I have a set of large XSDs, based on which a web service is producing XML output. I don't want to write actionscript classes by hand, that'd be huge piece of work.
Having source code in actionscript would help a lot, since writing code based on runtime binding of xml/json to objects is much more error prone compared to having proxy like classes. Any ideas?
update: I've found a wizard in Adobe's Flash Builder for doing what I've been looking for, but unfortunately, it died on me complaining about case sensitivity of entities and services names etc. So a 3rd party framework which can do this is still required.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 asaxb。它允许您根据元数据将 XML 解组为 ActionScript 对象。它至少是解决方案的一部分。
You can try out asaxb. It allows you to unmarshall XML into ActionScript objects based on metadata. It is at least part of the solution.