如何使用XSLT从XSD生成简单的文档 [英] How to generate simple documentation from XSD using XSLT

查看:501
本文介绍了如何使用XSLT从XSD生成简单的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几个XSD文件,其中一个有根元素,其他的是导入或包含的。这些XSD文件表示XML服务请求...为了文档原因,我需要提取根元素下的所有元素名称和属性。

We have several XSD files and one of them has the root element and others are imported or included. These XSD files represents an XML service request... for documentation reason, I need to extract all the element names and attributes under the root element.

我需要的是生产这样的东西:

What I need is to produce something like this:

<table>
  <tr>
     <td>ELELEMENT OR ATTRIBUTE NAME</td> 
     <td>Whether or not mandatory - by checking minOccurs="0"</td>
     <td>EMPTY OR THE TEXT VALUE under annotation/documentation IF AVAILABLE</td>
  </tr> 
</table>


推荐答案

我制作了一个xslt样式表, for:
https://github.com/S2-/xsddoc

I made an xslt stylesheet that does exactly what you asked for: https://github.com/S2-/xsddoc

这篇关于如何使用XSLT从XSD生成简单的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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