从 Xsd 构建 UI 的工具包或应用程序 [英] Toolkits or Applications That Build UI From Xsd

查看:27
本文介绍了从 Xsd 构建 UI 的工具包或应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个用户界面来编辑和创建符合给定 xsd 架构的 xml 文档.我想做的是,尽可能基于该 xsd 架构生成我的用户界面.xsd 架构可以(并且将会)随着时间的推移而改变,因此解决方案需要有一定的灵活性.

I need to build a user interface to edit and create xml documents that conform to a given xsd schema. What I'd like to do is, as far as possible, generate my user interface based upon that xsd schema. The xsd schema can (and will) change over time and so the solution needs to be somewhat flexible.

用户界面需要是一个 Web UI,并且最好是使用 ASP.NET MVC 构建的.

The user interface needs to be a web UI and, ideally, one built with ASP.NET MVC.

我怀疑这是一项艰巨的任务,而不是工具包或库可以完全解决的问题,但我很想知道是否有其他人沿着这条路走并成功(或失败),以及他们是否使用过有帮助的特定库、工具包或方法.我已经开始将 T4 模板视为一种方法,并觉得这会让我受益匪浅,但如果有更简单的方法,我不想承诺.

I suspect that this is a tall order and not one that can be fully addressed by a toolkit or library, but I'm interested to know if anyone else has gone down this path and succeeded (or failed) and whether they used particular libraries, toolkits or approaches that helped. I've started to look at T4 templates as an approach, and feel that this will get me a lot of the way, but don't want to commit to this if there are easier approaches.

推荐答案

我构建了一个引擎,它的功能与您所描述的非常相似,但不是使用 XSD,而是在 JSON Schema 和在浏览器中使用 Ext JS 框架.

I've built an engine that does something very similar to what you are describing but instead of using XSD, the schema was defined in JSON Schema and the interface rendered in the browser using the Ext JS framework.

它是非常强大的 JavaScript,但在开发和维护过程中节省的时间方面为我们带来了巨大的好处.

It is pretty intense JavaScript but the benefits have been enormous for us in terms of time saved during development and maintenance.

我不知道是否有一种工具可以完全满足您的要求,但最简单的方法是找到一个灵活、可靠的 GUI 框架(例如 Ext JS、YUI、Dojo 等)并将每种类型映射到将您的 XSD 转换为 GUI 框架中的小部件类型".您基本上必须为每种类型保留预配置",并在解析 XSD 时应用它们.在概念层面上,它实际上非常简单.

I don't know if there is a tool that does exactly what you require, but the easiest path is to find a flexible, solid GUI framework (such as Ext JS, YUI, Dojo, etc) and map each type in your XSD to a 'widget type' in the GUI framework. You will have to basically keep 'pre-configurations' for each of those types and apply them as you parse the XSD. At a conceptual level, it's actually quite simple.

由于其动态性,JavaScript 成为完成此类任务的绝佳语言.

JavaScript turned out to be a fantastic language for such a task because of its dynamicity.

这篇关于从 Xsd 构建 UI 的工具包或应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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