home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / Sharpdev / 099bsetup.exe / ShowXmlDocumentation.xsl < prev    next >
Extensible Markup Language  |  2003-08-28  |  7KB  |  277 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!--
  3.     Modified version of a XSLT with following copyright:
  4.  
  5. Lutz Roeders's .NET Reflector, October 2000.
  6. Copyright (C) 2000-2002 Lutz Roeder. All rights reserved.
  7. http://www.aisto.com/roeder/dotnet
  8. roeder@aisto.com
  9.  
  10. Thanks fly out to Lutz Roeder for giving permission to use his XSLT :)
  11. All bugs in this XSLT belong to Mike Krueger mike@icsharpcode.net and are 
  12. protected by international copyright laws
  13.  -->
  14. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  15.     <xsl:output method="html" indent="no" />
  16.     
  17.     <xsl:template match="/">
  18.         <BODY ID="bodyID" CLASS="dtBODY">
  19.             <DIV ID="nstext">
  20.                 <xsl:apply-templates select="member"/>
  21.             </DIV>
  22.         </BODY>
  23.     </xsl:template>
  24.     
  25.     <xsl:template match="member">
  26.         <xsl:if test="summary">
  27.             <xsl:apply-templates select="summary"/>
  28.         </xsl:if>
  29.         
  30.         <xsl:if test="param">
  31.             <H4 CLASS="dtH4">Parameters</H4>
  32.             <DL><xsl:apply-templates select="param"/></DL>
  33.         </xsl:if>
  34.         
  35.         <xsl:if test="returns">
  36.             <H4 CLASS="dtH4">Return Value</H4>
  37.             <xsl:apply-templates select="returns"/>
  38.         </xsl:if>
  39.         
  40.         <xsl:if test="value">
  41.             <H4 CLASS="dtH4">Value</H4>
  42.             <xsl:apply-templates select="value"/>
  43.         </xsl:if>
  44.         
  45.         <xsl:if test="exception">
  46.             <H4 CLASS="dtH4">Exceptions</H4>
  47.             <DIV CLASS="tablediv">
  48.                 <TABLE CLASS="dtTABLE" CELLSPACING="0">
  49.                     <TR VALIGN="top">
  50.                         <TH WIDTH="50%">Exception Type</TH>
  51.                         <TH WIDTH="50%">Condition</TH>
  52.                     </TR>
  53.                     <xsl:apply-templates select="exception"/>
  54.                 </TABLE>
  55.             </DIV>
  56.         </xsl:if>
  57.         
  58.         <xsl:if test="permission">
  59.             <H4 CLASS="dtH4">Permission</H4>
  60.             <DIV CLASS="tablediv">
  61.                 <TABLE CLASS="dtTABLE" CELLSPACING="0">
  62.                     <TR VALIGN="top">
  63.                         <TH WIDTH="50%">Member</TH>
  64.                         <TH WIDTH="50%">Description</TH>
  65.                     </TR>
  66.                     <xsl:apply-templates select="permission"/>
  67.                 </TABLE>
  68.             </DIV>
  69.         </xsl:if>
  70.         
  71.         <xsl:if test="remarks">
  72.             <H4 CLASS="dtH4">Remarks</H4>
  73.             <xsl:apply-templates select="remarks"/>
  74.         </xsl:if>
  75.         
  76.         <xsl:if test="example">
  77.             <H4 CLASS="dtH4">Example</H4>
  78.             <xsl:apply-templates select="example"/>
  79.         </xsl:if>
  80.     
  81.         <xsl:if test="seealso">
  82.             <H4 CLASS="dtH4">See Also</H4>
  83.             <xsl:apply-templates select="seealso"/>
  84.         </xsl:if>
  85.         <BR/><BR/>
  86.     </xsl:template>
  87.     
  88.     <xsl:template match="text()">
  89.         <xsl:value-of select="."/>
  90.     </xsl:template>
  91.     
  92.     <!-- Inner Tags -->
  93.     <xsl:template match="c">
  94.         <pre class="code">
  95.             <xsl:apply-templates/>
  96.         </pre>
  97.     </xsl:template>
  98.     
  99.     <xsl:template match="exception">
  100.         <TR VALIGN="top">
  101.             <TD WIDTH="50%">
  102.                 <A>
  103.                     <xsl:attribute name="href">
  104.                         urn:member:<xsl:value-of select="@cref"/>
  105.                     </xsl:attribute>
  106.                     <xsl:attribute name="title">
  107.                         <xsl:value-of select="@cref"/>
  108.                     </xsl:attribute>
  109.                     <xsl:value-of select="@cref"/>
  110.                 </A>
  111.             </TD>
  112.             <TD WIDTH="50%">
  113.                 <xsl:apply-templates/>
  114.             </TD>
  115.         </TR>
  116.     </xsl:template>
  117.     
  118.     <xsl:template match="list">
  119.         <xsl:if test="@type[.='table']">
  120.             <DIV CLASS="tablediv">
  121.                 <TABLE CLASS="dtTABLE" CELLSPACING="0">
  122.                     <xsl:for-each select="listheader">
  123.                         <TR VALIGN="top">
  124.                             <TH WIDTH="50%">
  125.                                 <xsl:for-each select="term">
  126.                                     <xsl:apply-templates/>
  127.                                 </xsl:for-each>
  128.                             </TH>
  129.                             <TH WIDTH="50%">
  130.                                 <xsl:for-each select="description">
  131.                                     <xsl:apply-templates/>
  132.                                 </xsl:for-each>
  133.                             </TH>
  134.                         </TR>
  135.                     </xsl:for-each>
  136.                     <xsl:for-each select="item">
  137.                         <TR VALIGN="top">
  138.                             <TD WIDTH="50%">
  139.                                 <xsl:for-each select="term">
  140.                                     <xsl:apply-templates/>
  141.                                 </xsl:for-each>
  142.                             </TD>
  143.                             <TD WIDTH="50%">
  144.                                 <xsl:for-each select="description">
  145.                                     <xsl:apply-templates/>
  146.                                 </xsl:for-each>
  147.                             </TD>
  148.                         </TR>
  149.                     </xsl:for-each>
  150.                 </TABLE>
  151.             </DIV>
  152.         </xsl:if>
  153.         <xsl:if test="@type[.='bullet']">
  154.             <UL>
  155.                 <xsl:for-each select="item">
  156.                     <LI>
  157.                         <xsl:for-each select="term">
  158.                             <xsl:apply-templates/>
  159.                         </xsl:for-each>
  160.                     </LI>
  161.                 </xsl:for-each>
  162.             </UL>
  163.         </xsl:if>
  164.         <xsl:if test="@type[.='number']">
  165.             <OL type="1">
  166.                 <xsl:for-each select="item">
  167.                     <LI>
  168.                         <xsl:for-each select="term">
  169.                             <xsl:apply-templates/>
  170.                         </xsl:for-each>
  171.                     </LI>
  172.                 </xsl:for-each>
  173.             </OL>
  174.         </xsl:if>
  175.     </xsl:template>
  176.     
  177.     <xsl:template match="param">
  178.         <DT><I>
  179.             <xsl:value-of select="@name"/>
  180.         </I></DT>
  181.         <DD>
  182.             <xsl:apply-templates/>
  183.         </DD>
  184.     </xsl:template>
  185.     
  186.     <xsl:template match="paramref">
  187.         <I>
  188.             <xsl:value-of select="@name"/>
  189.         </I>
  190.     </xsl:template>
  191.     
  192.     <xsl:template match="permission">
  193.         <TR VALIGN="top">
  194.             <TD WIDTH="50%">
  195.                 <A>
  196.                     <xsl:attribute name="href">
  197.                         urn:member:<xsl:value-of select="@cref"/>
  198.                     </xsl:attribute>
  199.                     <xsl:attribute name="title">
  200.                         <xsl:value-of select="@cref"/>
  201.                     </xsl:attribute>
  202.                     <xsl:value-of select="@cref"/>
  203.                 </A>
  204.             </TD>
  205.             <TD WIDTH="50%">
  206.                 <xsl:apply-templates/>
  207.             </TD>
  208.         </TR>
  209.     </xsl:template>
  210.     
  211.     <xsl:template match="see">
  212.         <xsl:choose>
  213.             <xsl:when test="@langword">
  214.                 <B><xsl:value-of select="@langword"/></B>
  215.             </xsl:when>
  216.             <xsl:when test="@cref">
  217.                 <A>
  218.                     <xsl:attribute name="href">
  219.                         urn:member:<xsl:value-of select="@cref"/>
  220.                     </xsl:attribute>
  221.                     <xsl:attribute name="title">
  222.                         <xsl:value-of select="@cref"/>
  223.                     </xsl:attribute>
  224.                     <xsl:value-of select="@cref"/>
  225.                 </A>
  226.             </xsl:when>
  227.             <xsl:when test="@internal">
  228.                 <U>
  229.                     <xsl:value-of select="@internal"/>
  230.                 </U>
  231.             </xsl:when>
  232.             <xsl:when test="@topic">
  233.                 <U>
  234.                     <xsl:value-of select="@topic"/>
  235.                 </U>
  236.             </xsl:when>
  237.         </xsl:choose>
  238.     </xsl:template>
  239.     
  240.     <xsl:template match="seealso">
  241.         <xsl:choose>
  242.             <xsl:when test="@cref">
  243.                 <A>
  244.                     <xsl:attribute name="href">
  245.                         urn:member:<xsl:value-of select="@cref"/>
  246.                     </xsl:attribute>
  247.                     <xsl:attribute name="title">
  248.                         <xsl:value-of select="@cref"/>
  249.                     </xsl:attribute>
  250.                     <xsl:value-of select="@cref"/>
  251.                 </A>
  252.             </xsl:when>
  253.             <xsl:when test="@topic">
  254.                 <U><xsl:value-of select="@topic"/></U>
  255.             </xsl:when>
  256.         </xsl:choose>
  257.         <xsl:if test="position()!=last()"> | </xsl:if>
  258.     </xsl:template>
  259.     
  260.     <xsl:template match="para">
  261.         <P>
  262.             <xsl:apply-templates/>
  263.         </P>
  264.     </xsl:template>
  265.     
  266.     <xsl:template match="code">
  267.         <pre class="code">
  268.             <xsl:if test="@lang">
  269.                 <SPAN CLASS="lang">[<xsl:value-of select="@lang"/>]</SPAN>
  270.                 <BR/>
  271.             </xsl:if>
  272.             <xsl:value-of select="."/>
  273.         </pre>
  274.     </xsl:template>
  275.     
  276. </xsl:stylesheet>
  277.