本文介绍了XSD 到 XForms 和 XForms 到 XSD 的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我遇到两个问题:

  1. 我从外部服务器收到一个 XSD 文件,我必须根据这个文件生成 XForm.通常 XSD 文件会导入许多其他 XSD 文件等.
  2. 我正在使用 XForm 构建器编写 GUI.当用户构建他的自定义 XForm 时,我需要从中生成一个 XSD 文件并将其发送回外部服务器.

主要问题是:是否可以编写这两个生成文件并符合标准(XML Schema 和 XForms)的转换器?您是否知道任何现有的库提供这两种格式之间的转换:XSD 和 XHTML?

Major question is: Is it possible to write those two converters which generate files and complies with the standard (XML Schema and XForms)?Do you know any existing library offering conversion between those two formats: XSD and XHTML?

值得一提的是,所有约束(非空、数值等)也需要转换.

It is important to mention that all constraints (not empty, numeric value, etc) need to be transformed as well.

我只有关于 XML 技术(XLS、XPath、XQuery...)的基本知识,所以任何建议都会有所帮助.

I have only basic knowledge about XML technologies (XLS, XPath, XQuery...) so any suggestion will be helpful.

推荐答案

很多人(包括我在内)都希望将 XML Schema 转换为 XForms 生成器,但是由于 XML Schema 的复杂性,直到现在还很难实现.

Many people (including me) expects to get that XML Schema to XForms generator, but due to the complexities of XML Schema it has been hard to achieve until now.

看看这三个项目:

https://code.google.com/p/xrx/ Dan McCreary 创建XRX,一种使用示例构建基于 XML 的应用程序的架构,其中一个示例使用 XQuery 从 XSD 模式生成 XForms.

https://code.google.com/p/xrx/ Dan McCreary created XRX, an architecture for building XML based applications with examples, and one of the examples generates XForms from XSD Schemas using XQuery.

https://github.com/lcahlander Loren Cahlander 有一个名为 govworks 的有趣项目,其中包括 XForms 的生成来自 XSD Schemas,也使用 XQuery,如 XRX

https://github.com/lcahlander Loren Cahlander has an interesting project called govworks that includes generation of XForms from XSD Schemas, also using XQuery, like XRX

http://sourceforge.net/projects/schema2xforms/ Steve Cameron 创建了一个视觉设计师对于生成 XForms 的模式,使用 XSLT

http://sourceforge.net/projects/schema2xforms/ Steve Cameron has created a visual designer for Schemas that generates XForms, using XSLT

所有这些人都非常友善,他们肯定会为您提供帮助.

All these guys are very kind and for ure they will offer you help.

坏消息是,目前这三个项目都不支持导入外部架构.这是 XML Schema 最复杂的特性.

The bad news are that Importing external Schemas is not supported on none of these three projects right now. That's the most complex feature of XML Schema.

IBM 从 Schemas 构建了一个 XForms 生成器作为 Eclipse 的插件,但它已被放弃并且不再可供下载:-(

IBM built an XForms generator from Schemas as a plugin for eclipse, but it has been abandoned and no longer available for download :-(

这篇关于XSD 到 XForms 和 XForms 到 XSD 的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 13:42