Thursday, April 14, 2011

CHM file from XSD files

Is it possible to create a CHM file or HTML help (akin to those created by Sandcastle) from an XSD file? Text in the xs:documentation nodes contains, well, the documentation.

An example snippet from one of the XSD files I have is

<xs:element name="Request" type="RequestType">
 <xs:annotation>
  <xs:documentation>
   <html:p>The Request message contains a number of <html:i>RequestType</html:i> elements for the server to process.</html:p>
   <html:p>A <html:i>Request</html:i> will always result in a <html:i>Response</html:i> message being returned by the server, and <html:b>must</html:b> contain an <html:b>xmlns=[<html:i>Default namespace</html:i>]</html:b> declaration.</html:p>
  </xs:documentation>
 </xs:annotation>
</xs:element>
<xs:element name="Response" type="ResponseType">
 <xs:annotation>
  <xs:documentation>The Response message contains the result of a previous <html:i>Request</html:i> message, with one <html:i>ResponseType</html:i> element for each <html:i>RequestType</html:i> sent to the server.</xs:documentation>
 </xs:annotation>
</xs:element>
From stackoverflow
  • There's a XSLT called "xs3p" which can be downloaded from xml.fiforms.org/xs3p.

    You can use any XSLT processor to convert your XSD into HTML - I use "nxslt3" by Oleg Tkachenko.

    A second step would then be to combine several HTML into a CHM using some Html Help builder.

    Marc

    PS: forgot to mention - both tools are free, of course :-)

  • XML Schema Documenter is a Sandcastle Help File Builder plug-in that allows you to integrate reference documentation for XML schemas in your help files.

    xsddoc.codeplex.com

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.