Adding 'created by' and 'history' to your Xml documentation with NDoc

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 parametere</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.

Print | posted on Friday, August 12, 2005 4:01 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)