xsltxsddocumentationxsl-stylesheet

How to generate simple documentation from XSD using XSLT


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>

Solution

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