 |
|
 |
Hi Emma,
here is something i wanted to let you know.
In some cases your xsl doesn't do the right thing because your xpath expressions for methods, fields find more than they should.
This happens when names of types start with the same characters, e.g. types "NU" and "NUnit".
The problem can be solved if you include the dot in your second variable:
But instead you would have remove the inclusion in some other cases below.
Hope that this helps.
Otherwise you article is of great help to get started with documentation.
Thanx,
Lothar
|
|
|
|
 |
|
 |
If you open the .xml file which contains the xml comments in VS you can use the XML/Show XSLT Output menu item to browse to this .xslt and convert the xml to html. (You will need to delete the blank line at the top of the xslt first)
|
|
|
|
 |
|
|
 |
|
 |
This article was just what I needed to get started in the right direction quickly. Thanks a bunch!
|
|
|
|
 |
|
 |
To add some CSS to make the styled XML look a little more legible, you can do something like this:
="1.0" ="ISO-8859-1"
-->
-->
-->
-->
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-->
-->
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body {
background-color: #ffffcc;
}
h1, h2, h3, h5, p {
font-family: Georgia,serif;
}
h2 {
color: #993300;
}
h3 {
margin-left: 25px;
}
h4 {
margin-left: 50px;
font-family: lucida console,monospace;
font-weight: normal;
color: #3366ff;
}
h5 {
font-style: italic;
font-weight: normal;
text-decoration: underline;
}
h5, p {
margin-left: 75px;
}
</style>
</head>
<body>
...
|
|
|
|
 |
|
 |
an automated way to add the style sheet reference
(?xml-stylesheet type="text/xsl" href="Documentation.xsl"? line) will be perfect for me.
thanks anyway for the work on your XSLT, i just added a reference to our CSS file to have our related style sheet.
MS Visual Studio 2008
Fred
|
|
|
|
 |
|
 |
I also want to thank you for your good work. While I’m new to XLST I was able to follow your code, and I ran tests on XML documents generated from comments included in a couple of simple VB projects. The first XML was from a VB project that included only one class. Your XLST produced output as I would expect.
However, the second XML was from a VB project that had no class, but instead had one module with functions that included comments. While the XML file contained data from the module’s function comments, your XLST did not output this information. I believe the problem arises from the XML document not having any member that contains a ‘T:’ associated with the VB module. Therefore nothing associated with the module gets processed in your XLST. Any suggestions as to how to address this problem?
Thanks for your help.
|
|
|
|
 |
|
 |
First of all, great work on this XSLT. It really made it easy for me to set up a decent looking and well printing documentation set for my company. Its pretty simple to structure the output HTML and with the addition of a little CSS everything came together nicely. I have run into trouble with the methods section though and I'm hoping you can offer some advice...
The problem is with two similarly named classes in my application. One of them is clsCampaign and the other is clsCampaignManager. The methods selector is pulling all of the methods for clsCampaignManager when displaying clsCampaign's methods. I think this may be because you are using some sort of "contains" function to compare against the method names. I'm not that familiar with XSLT so that may be an incorrect assumption. Do you have any ideas about how I might solve this problem?
Thank you
EDIT:
I have a working (but not thoroughly tested) solution. At least it seems to be working so far
<!---->
<xsl:if test="//member[contains(@name,concat('M:',$FullMemberName))]">
<H3>Methods</H3>
<xsl:for-each select="//member[contains(@name,concat('M:',$FullMemberName<code>,'.'</code>))]">
<!---->
<div class="methodBlock">
<div class="methodSignature">
Basically what this does, is force the selector to match all the way to the end of the method name because it has to match to the dot ('.') which should always appear after the Type in the namespace string but before the method signature. Please let me know if you think this is a good solution.
Thanks again
modified on Monday, March 30, 2009 7:12 PM
|
|
|
|
 |
|
 |
Thank you Emma! You're my hero
|
|
|
|
 |
|
 |
Thought it would be very simple to find such a file on the internet.
This is the only one I found after some searcing that works for me. I have not digged into the syntax of xsl files and just needed one that works.
|
|
|
|
 |
|
 |
Good XSLT for my XML file generated.. it has been very helpful..
thnaks
|
|
|
|
 |
|
 |
assemblies and XML documentation files produced by Visual C#.NET
|
|
|
|
 |
|
 |
XML comments are great but they have drawbacks.
I generally find it good for documenting a specific function, but sometimes, I wished there was an efficient way of linking to a more general topic, describing the overall workings of the code. It should be possible to add a link (could be some kind of unique identifier generated by VS inserted into XML comment) to a section of a document (XML,Word or any other appropriate type of document) and to be able to edit this section quickly (VS should be able to follow the link). It would be a great help to keep the more general documentation up to date!
XLM comments also makes the code a bit overloaded... but the benefits are to great to not use them.
|
|
|
|
 |
|
 |
I spent an hour searching for this very thing today ... it was great to find your solution. Thanks for taking the time to contribute back to the community. -Mark h--p/devaustinDAHTworpressDAHTcom
|
|
|
|
 |
|
 |
I am trying to get the group I work with to see the value of XML commenting. I needed a basic XSLT file that I could manipulate (I am too lazy to create it from scratch).
Tracy Wallace
|
|
|
|
 |
|
 |
Yes, when I was in a similar situation, I had to write my own - I'm glad I've spared someone the same trouble!
|
|
|
|
 |
|
 |
Thanks for the article but I mis one thing:
I need to document methods of our web services that return structured XML in various formats.
I include output examples in hte sections but your xsl doesn't copy the XML tags.
I'm not familiar with xsl syntax, any solution?
Thanks.
Example:
C#:
----
///
/// Customer gets more credits to his/her acct
///
///
///
///
///
/// status""
/// if fails then extra output:
/// ErrorMessage ";
/// ";
///
/// Example:
///
/// -
/// -
/// false
///Invalid object name 'sr.Users'.
///
///
///
///
[WebMethod]
public XmlDocument BuyCredits(string CustomerID, ...)
HTML output:
---------------
...
Return Value:
status""
if fails then extra output:
ErrorMessage ";
";
Example:
-
- falseInvalid object name 'sr.Users'.
...
Thanks in advance
|
|
|
|
 |
|
 |
In fact, your tags are technically still there - the stylesheet isn't designed to do anything special with them, so they just get ignored by whatever is displaying the data (Internet Explorer, for instance). You'll notice that your message here has suffered the same fate.
The workaround is for you to replace the leading "<" in each case with "<" - this will work fine in the output file and IntelliSense, though of course, it looks awful in the original code.
I have tried various changes to the stylesheet, but unfortunately nothing I've tried has worked so far, so for the moment, that's all I can suggest. I'll look into it further and post a solution here if I find one.
|
|
|
|
 |
|
 |
Thanks for your kind and prompt reply.
However your reply reads 'replace evry "<" with "<"' .
I needed a colleague's help to realize ("View Source") that you meant
'replace every "<" with "&-l-t-;" (remove the dashes).
It worked - thanks.
|
|
|
|
 |
|
 |
TheOF wrote: However your reply reads 'replace evry "<" with "<"' .
I should have thought of that given the way the forum interprets HTML code. I'm glad your colleague worked it out for you, and of course very pleased to hear that it worked! Thanks for the feedback.
|
|
|
|
 |
|
 |
Another feasible solution is called Doxygen
http://www.stack.nl/~dimitri/doxygen/
It generates HTML.
The primary use for doxygen is for C projects, but they have partially extended it for CSharp projects. This package works at a source code level, as opposed to a compiled IL level like SandCastle.
|
|
|
|
 |
|
 |
Just what I needed to generate some text for a Technical Design Document. It was pretty easy to modify your XSL stylesheet to return what I wanted.
One thing I found that you might want to add is some sorting. I found that by putting <xsl:sort select="@name" data-type="text" order="ascending"/> after every For-Each and every apply-template; the methods, parameters, fields, etc all came out sorted. It was a big help to me anyway.
Craig C.
C code. C code run. Run code run!
|
|
|
|
 |
|
 |
This is very convenient. It allowed me to make some quick documentation. I'm suprised Visual Studio doesn't have something to generate documentation in HTML or Text or whatever (instead of just intellisense), or does it...?
|
|
|
|
 |
|
 |
I don't know if there's anything inbuilt - nothing jumped out at me when I wanted something similar, which is why I designed this template. I'm glad to hear that it was useful!
|
|
|
|
 |
|
 |
Hi Emma,
I am using Visual Studio 2005 with '/doc' option. I downloaded your 'Documentation.xsl', then added 'xml-stylesheet' description. I opened XML, but I can't see anything on my browser (IE6).
Is your XSL file working with VS2005 correctly?
|
|
|
|
 |