 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | 4.25/5 (3 votes) |
|
|
|
 |
|
 |
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,'.'))]"> <!----> <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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Yes, when I was in a similar situation, I had to write my own - I'm glad I've spared someone the same trouble!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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 /// /// /// /// /// /// Example: /// /// [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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
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!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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...?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It's working fine here ... with a little modification, though. I deleted the top blank line in the stylesheet file after getting errors in Opera and Firefox. I also noticed that to be able to see the methods within a class, I needed to at least add summary tags to the class itself. Hope it helps.
|
| Sign In·View Thread·PermaLink | 3.00/5 (3 votes) |
|
|
|
 |
|
 |
Hi ! Nice job I wanted to see it in FireFox and it told me
XML Parsing Error: xml processing instruction not at start of external entity Location: file:///D:/TP5/Projects/TpCommunicator/TpCommunicator/Documentation.xsl Line Number 6, Column 1:
I just had to put your " don't remove this header " After the first line.
Internet Explorer, as usual, is not as strict, and allow comments before |
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the info - I must admit my PC is Microsoft-dominated, so I didn't know that could be a problem. I hope the stylesheet will prove useful for whatever "TpCommunicator" is. 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello
Can someone help me! I have a problem about xslt I want to use attribute to be a condition what should I write xslt command or function this is my xml file
<assess_controls> <assess_control> <<b>company_name</b>><u>xxx</u></company_name> <<b>form_name</b> <b>no</b>="<u>1</u>">form_xxx</form_name> <assesser_name>xxx</assesser_name> <control_type>xxx</control_type> <control_subgroup sub_group="1 xxx"> <activitys> <activity>xxx</activity> <comment>comment 1</comment> </activitys> </control_subgroup> <control_subgroup sub_group="2 xxx"> <activitys> <activity>xxx3 </activity> <comment>comment 3</comment> </activitys> </control_subgroup> </assess_control> <assess_control> <company_name>xxx</company_name> <form_name no="2">form_xxx</form_name> <assesser_name>yyy</assesser_name> <control_type>yyy</control_type> <control_subgroup sub_group="1 yyy"> <activitys> <activity>yyy</activity> <comment>comment 1</comment> </activitys> </control_subgroup> <control_subgroup sub_group="2 yyy"> <activitys> <activity>yyy3 </activity> <comment>comment 3</comment> </activitys> </control_subgroup> </assess_control> </assess_controls>
<big>I want to use <company_name>, <form_name> and attribute of form_name "no" and xslt if below</big>
<xsl:param name="<b>comp</b>">admin</xsl:param> <xsl:param name="<b>formname</b>">pppp</xsl:param> <xsl:param name="<b>formno</b>">1</xsl:param> <xsl:template match="/"> <HTML> <body STYLE="font-family:Arial, helvetica, sans-serif; font-size:10pt; background-color:#EEEEEE"> <xsl:apply-templates/> </body> </HTML> </xsl:template> <xsl:template match="assess_control"> <xsl:if test="company_name = <b>$comp</b>"> <xsl:if test="form_name = <b>$formname</b>"> <xsl:apply-templates select= "form_name"/> <table class = "borders" border = "1"> <tr class = "largebluetext"> <td><xsl:value-of select="company_name"/></td> <td><xsl:value-of select="control_type"/></td> <td><xsl:value-of select="control_group"/></td></tr> <tr><td><xsl:value-of select ="form_name"/></td></tr> </table> <xsl:apply-templates select ="control_subgroup "/> <xsl:value-of select="@sub_group"/> </xsl:if> </xsl:if> </xsl:template> <xsl:template match="form_name"> <xsl:if test="<b>$formno</b>"> <table><tr><td>no: <xsl:value-of select="@no"/></td></tr></table> </xsl:if> </xsl:template>
<xsl:template match="control_subgroup"> <span class="blacktext"> <xsl:value-of select="@sub_group"/> </span> <xsl:for-each select="activitys"> <table class = "borders" border = "1"> <tr class = "largeyellowtext"> <td class = "borders1"><xsl:value-of select="activity"/></td> <td class = "borders2"><xsl:value-of select="score"/></td> <td class = "borders3"><xsl:value-of select="comment"/></td></tr> </table> </xsl:for-each> </xsl:template>
</xsl:stylesheet>
The problem is I can't specify form_name[@no] I want. What wrong of my xslt code?
Thank you very much
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |