2

Possible Duplicates:
How to convert xsd to human readable documentation?
Formatting XSD scheme for peer review

I have a XSD file that includes xsd:annotation elements which contains a xsd:documentation element

<xsd:element name="CompanyId" minOccurs="0">
    <xsd:annotation>
        <xsd:documentation>The name of the company.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="40"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:element>

How can I get the schema into a file (doc, spreadsheet, etc.) that would allow non-tech people to look at the contents of schema to better understand what data is available?

I want then to see that the field CompanyID contains "The name of the company." as shown in the xsd:documentation. It would even be nice to see the length is up to 40 characters.

Community
  • 1
  • 1
user31673
  • 13,245
  • 12
  • 58
  • 96

2 Answers2

3

Take a look at the schema for the XML namespace at

http://www.w3.org/2001/xml.xsd

When you view it in a browser, it is displayed using a client-side XSLT stylesheet; you can use the same stylesheet to browse your own schemas. The stylesheet is at

http://www.w3.org/2008/09/xsd.xsl

You could, of course, adapt it to your needs rather than using it directly.

Note: when you click on the first link above, be patient. W3C deliberately delays the response to requests for commonly-used files like this, to encourage applications to maintain a local copy.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
0

Use an xslt converter to some documentation format like this one : http://xml.fiforms.org/xs3p/

See also : How to convert xsd to human readable documentation?

To use it you need an xslt application. If you're using Visual Studio (whatever the version), open the xs3p file in the IDE, then go in the menu : XML->Run (or something similar), it will ask for an input file and you will provide the xsd file. Once finished you'll get a file that is a XHTML file (so you might want to rename it) and you can open it in a browser. As pointed in the xs3p page, the documentation should like there : http://xml.fiforms.org/xs3p/examples/XMLSchema.xsd.html

If you don't have Visual Studio available, you can find other xslt processors easily on your platform.

Community
  • 1
  • 1
Klaim
  • 67,274
  • 36
  • 133
  • 188