codecorner.tigernews.co.uk

     from TIGER COMPUTER SERVICES LTD

Top Right Logo Spacer
site copyright 2000-2010
     C# (C Sharp) Track Data Access TrackPocket PC TrackSQL Server Track
About the C# (C Sharp) Track Tips and Tricks for C# (C Sharp) Generic Database Access - MDB, SQL Server 2000 and SQL CE

Extending your XML documentation with NDoc to include change history

In your XML documentation comments include the tags as shown below, with a single created element, and multiple history elements;

/// <remarks>If <b>propertyHolderVariableName</b> parameter is used then the caller must ensure a private property variable has been declared elsewhere in the class module.</remarks>
/// <created>Liam Westley 09 Feb 2004</created>
/// <history>Liam Westley 02 Nov 2004, added propertyHolderVariableName parameter</history>
/// <history>Liam Westley 05 Nov 2004, added comment about minValue can be null for System.String based properties</history>
public Property(Language lang, string propertyName,

Then you can use an XSLT stylesheet to render these in your NDoc generated documentation;

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">

       <xsl:template match="node()" mode="xml-data-island" priority="1">
              <MSHelp:Attr Name="TargetOS" Value="Windows"/>
       </xsl:template>        

       <xsl:template match="created" mode="seealso-section">
       <h4 class="dtH4">Revision history</h4>
       <xsl:value-of select="."/> (created)<br/>
       </xsl:template>     

       <xsl:template match="history" mode="seealso-section">
       <xsl:value-of select="."/><br/>
       </xsl:template>

       <xsl:template match="null" mode="slashdoc">

              <xsl:text> null reference (Nothing in Visual Basic) </xsl:text>

       </xsl:template>

</xsl:stylesheet>


Save the above stylesheet as an .xslt file and in your Ndoc project specify this file as your 'ExtensibilityStylesheet'. You will then get a single 'created by' line with multiple 'history' lines in your NDoc generated documentation.