Generating xml using Sandcastle

Currently we generate HTMs as the output from Sandcastle. Several users have asked me about generating xml using Sandcastle.The following steps provide information on how to generate xml using Sandcastle:

  1. Create an xml sub-directory under your Output folder.

  2. Add a save component step as shown below before the sandcastle.config file before the "transform step". Please see the attached Sandcastle.config file.

    <!-- save the xml result -->

    <component type="Microsoft.Ddue.Tools.SaveComponent" assembly="{path}/

    BuildComponents.dll"> <save path="concat('Output\html\',/document/reference/file/@name,'.xml')" indent="false" omit-xml-declaration="true" /> </component>

  3. Run your build and Sandcastle will generate xml and htm files under your output directory.

The xml generated by Sandcastle has a simple schema. It’s defined in the following structure:

<document>

<reference />

<syntax />

<comments />

</document>

The <reference> element contain all the reflection data. The <syntax> element is contains the syntax information and <comments> contain the /// comments.

I will be happy to hear your comments.

Anand..

 

sandcastle.config