从 xsd 获取 html 表单 [英] Get html form from xsd

查看:33
本文介绍了从 xsd 获取 html 表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常复杂的 xsd 文件来描述一些对象(这并不重要,但它是 DATEX II 标准)你知道是否有一种自动的方式来创建一个 html 表单,它就像一个向导"来指导用户创建 xml 对象,如 xsd 中描述的那样?

I have a quite complex xsd file that describe some objects (it's not important, but it's the DATEX II standard) Do you know if there is an automatic way to create an html form that act like a "wizard" to guide the user to create xml object as described in the xsd?

推荐答案

这个问题的答案取决于预期的用户群、您希望用户如何访问您的表单以及您已经拥有的技术堆栈或您的愿意部署.

The answer to this depends on the intended user base, how you want your users to access your forms, and the technology stack you have in place already or you're willing to deploy.

如果您的用户是质量控制分析师,并且目的是让他们使用生成的 UI 来管理测试用例,那么少数商业工具具有此功能.在 Google 上快速搜索诸如从 XSD 生成 ui 表单以测试 Web 服务"之类的术语应该会在第一页为您提供该领域的主要参与者(我不会命名以避免利益冲突).供应商处理此问题的方式存在差异,这与从大量 XML Schema 生成这些表单所需的时间有关,这反过来又转化为不同程度的可用性.鉴于我在 DATEX 中看到的情况,从复杂性的角度来看,您可能很难找到免费的工具...

If your users are quality control analysts, and so the intent is to have them use that generated UI to manage test cases, then a handful of commercial tools have this ability. A quick search on Google for terms such as "generate ui forms from XSD to test web services" should give you on first page the major players in this space (I won't name names to avoid conflict of interests). There are differences in how vendors approach this, that have to do with the time it takes to generate these forms from large bodies of XML Schema, which in turn translate into different degrees of usability. Given what I see in DATEX, from a complexity perspective, you may have a hard time to find a free tool for this...

如果您的用户是数据输入专家,那么上述工具并不是您希望他们使用的工具.在不了解您的环境的情况下(我看到了您的 java-ee 标记,但仍不清楚它与此任务的关系),一个模型可能是 InfoPath 与 SharePoint 的组合;虽然生成表单的过程不是全自动的,但它接近于自动生成.它是 XSD 驱动的,从某种意义上说,在设计时您将 XSD 拖放到设计表单上,这样您就可以构建一些非常好的 UI.关注他们在您的特定技术堆栈上的竞争,您可能会得到答案.或者,您可以访问列出 XForms 实现的 站点;IBM 的表单设计器,很像 InfoPath,可以使用 XML Schema 进行设计等.

If your users are rather data entry specialists, then the above are not the tools you want them to use. Without knowing much about your environment (I see your java-ee tag, but still not clear how it would relate to this task), one model could be a combination of InfoPath with SharePoint; while the process to generate the form is not fully automatic, it comes close to that. It is XSD driven, in the sense that at design time you drag and drop XSD on a design form, that allows you to build some really nice UI. Follow their competition on your particular technology stack and you may have your answer. Or, you can go to this site that lists XForms implementations; IBM's form designer, much like InfoPath, can use XML Schema for design, etc.

如果这是为了让开发人员获取一些 XML,另一种选择也可能是使用基于 Excel(或 SharePoint 列表)的方法并从该数据生成 XML(您放弃了购买特定于您的要求的东西的成本)工具,这里假设人们非常熟悉电子表格).

If this is for developers to get some XML, another alternative might also be to go with an Excel based (or SharePoint lists) approach and generate XML from that data (you give away cost to acquire something to build specific to your requirements tooling, here assuming people that are really familiar with spreadsheets instead).

鉴于 DATEX 模型的外观,如果您打算使用可扩展性模型,或者如果您选择为不同的场景构建不同的表单,即而不是一个大表单,那么您无论如何都必须进行一些手动自定义在某些下拉列表中为您提供抽象 payloadPublication 的所有后代,仅以特定的简单形式,例如测量站点表发布.

Given how DATEX model looks like, you'll have to do some manual customizations anyway, if you plan to use the extensibility model, or if you choose to build different forms for different scenarios i.e. instead of one big form that'll give you all descendents for the abstract payloadPublication in some drop down, to just a specific, simple form e.g. MeasurementSiteTablePublication.

这篇关于从 xsd 获取 html 表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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