XSD Editor Generate Documentation Using Custom Templates
In This Topic
It is possible to provide your own templates to the XSD Schema Documentation Generator. The generator uses XSLT 2.0 to perform the code generation, so you must supply one or more XSLT stylesheets.
The XSLT stylesheet operates on an XML document that is generated from the XSD schemas.
The schema for this can be found at <Installation Folder>/DocTemplates/SchemaInfo.xsd.
The HTML and ASP.Net templates are provided for reference and can be found in
- <Installation Folder>/DocTemplates/XsdToAspx
- <Installation Folder>/DocTemplates/XsdToHtml
The following Folders and files have special meaning. There location is relative to the initial XSLT style sheet provided to the generator.
- StaticFiles - The contents of this folder will be copied directly into the output folder (this includes all sub folders and files). This folder is optional, if it's not found no error is raised.
- PreTransform.bat - This is executed after the SchemaInfo.XML, and image files are generated, but before the XSLT transform is run. It allows the Image files or SchemaInfo.XML file to be moved or pre-processed. This file is optional, if it's not found no error is raised.
Example
If your setup is as follows
- Template file c:\Templates\MyTemplate.xslt
- Output folder c:\MyDocs
When the code generation is run the following steps are performed.
- The images are written to <Output Folder>\Images
In this example c:\MyDocs\Images
- The contents of the <Template Folder>\StaticFiles is copied to <Output Folder>
In this example the contents of c:\Templates\StaticFiles is copied to c:\MyDocs
- The Batch file <Template Folder>\PreTransform.bat is executed.
In this example c:\Templates\PreTransform.bat is executed.
- The XSLT Transform is executed.
In this example c:\Templates\MyTemplate.xslt, with the output folder set to c:\MyDocs.