You are here: Documenter for .NET > Adding Formatting and Links to XML Comment Text > Adding User-defined Tags and Attributes to XML Comments

Adding User-defined Tags and Attributes to XML Comments

Documenter for .NET supports any custom user-defined tags and attributes in XML comments. This is done through an optional XSLT transformation that can be specified in a Documenter project.

If you want to use some non-standard tags or attributes in your source code XML comments, you can create an XSLT transformation file that transforms the source code comments XML file containing the non-standard tags and attributes into an XML file that does not, or one that contains only tags and attributes supported by Documenter for .NET. If you specify such an XSLT transformation file in your Documenter project, Documenter will apply it to the source code comments XML file before using the XML file for document generation. You can see the transformed XML file after generation in the same directory with the source code XML file; its extension is .XMLT.

To specify an XSLT transformation file in a Documenter project:

1.   In Documenter, select Options from the Project menu. The Options dialog box appears.

2.   Under Comments Transformation, click Browse and, once located, select the .XSLT file.

3.   Click Open to close the Open dialog box and click OK to close the Options dialog box.

Documenter for .NET comes with one example of an XSLT, c1documenter.xslt, which can be found in the C:\Program Files\ComponentOne\DocToHelp\Documenter\Transforms folder. Note that this folder may be located elsewhere if you changed the default path during the Doc-To-Help installation.

This XSLT allows you to use a custom 'lang' attribute in the <code> tag. For example, the following XML comments:

will produce the following content in the generated document:

which will be shown in the help target as three dropdown text hotspots that, when clicked, show code examples in three different programming languages: