自动将 RelaxNG 模式转换为可编辑的 GUI
我有一个 RelaxNG 模式,我想创建符合该模式的文档,但使用该模式派生一个 GUI(最好是 Java),其中包含与该模式的元素相对应的字段。每个字段都与一个“验证器”相关联,该“验证器”强制执行架构中指定的该元素的约束。注意 - 这不是从 GUI 的 XML 定义派生 GUI。相反,我试图自动生成一个 GUI 编辑器,允许用户生成符合该架构的文档。
有没有开源工具可以做到这一点?
I have a RelaxNG schema and I'd like to create documents conforming to the schema, but using the schema to derive a GUI (preferably Java) that would contain fields corresponding to elements of the schema. Each field would be associated with a 'validator' that enforces the constraints for that element as specified in the schema. Note - this is not deriving a GUI from an XML definition of a GUI. Rather I'm trying to automatically generate a GUI editor that allows one to generate documents that conform to the schema.
Are there Open Source tools that are capable of this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有任何开箱即用的解决方案可以做到这一点。如果您想自己构建它,我建议使用 rngom http://java.net/projects/ rngom 作为起点。使用 rngom,您可以解析 RelaxNG 模式并从中生成对象模型。
从生成的对象模型中生成某种 GUI 应该不难。
不幸的是,根本没有关于如何使用 rngom 的文档,这就是为什么我发布了这个与 rngom 相关的问题: 使用 RNOM 从 RelaxNG 模式生成对象模型 - 如何开始?
我唯一知道的是 Glassfish 的人用它来生成 libvirt domain.xml RelaxNG schema (但我还不知道如何实现)。
I don't think that there is any out-of-the-box solution out there to do that. If you want to build that on your own, I'd suggest using rngom http://java.net/projects/rngom as a starting point. With rngom you can parse the RelaxNG schema and generate an object model out of it.
It should not be hard to generate some kind of GUI out of the generated object model.
Unfortunately, there is no documentation at all about how to use rngom, thats why I posted this rngom-related question: Generate object model out of RelaxNG schema with RNGOM - how to start?
The only thing I know is that the Glassfish guys use it to generate an object model for the libvirt domain.xml RelaxNG schema (but I could not find out how yet).