diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-22 22:49:10 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-22 22:49:10 -0700 |
commit | 3a27e20e3fc3f61fe25f9c3367b74dcbbfb82f48 (patch) | |
tree | e6eb3031a787160223e97e274b712fc05f24915f /tools | |
parent | e4e6423ed5f5ba51c500780b5ce72fcd64d63156 (diff) | |
download | DotNetOpenAuth-3a27e20e3fc3f61fe25f9c3367b74dcbbfb82f48.zip DotNetOpenAuth-3a27e20e3fc3f61fe25f9c3367b74dcbbfb82f48.tar.gz DotNetOpenAuth-3a27e20e3fc3f61fe25f9c3367b74dcbbfb82f48.tar.bz2 |
Patched up Sandcastle templates to include Code Contracts.
Diffstat (limited to 'tools')
3 files changed, 517 insertions, 251 deletions
diff --git a/tools/Sandcastle/Presentation/vs2005/Content/reference_content.xml b/tools/Sandcastle/Presentation/vs2005/Content/reference_content.xml index 8224e59..dfd9de0 100644 --- a/tools/Sandcastle/Presentation/vs2005/Content/reference_content.xml +++ b/tools/Sandcastle/Presentation/vs2005/Content/reference_content.xml @@ -165,6 +165,10 @@ <item id="exceptionConditionHeader">Condition</item> <item id="permissionNameHeader">Permission</item> <item id="permissionDescriptionHeader">Description</item> + <item id="requiresNameHeader">Requires</item> + <item id="ensuresNameHeader">Ensures</item> + <item id="ensuresOnThrowNameHeader">EnsuresOnThrow</item> + <item id="invariantsNameHeader">Invariants</item> <!-- filter control text --> <item id="allTypesFilterLabel">All Types</item> diff --git a/tools/Sandcastle/Presentation/vs2005/Content/shared_content.xml b/tools/Sandcastle/Presentation/vs2005/Content/shared_content.xml index 9f72e74..75d17fd 100644 --- a/tools/Sandcastle/Presentation/vs2005/Content/shared_content.xml +++ b/tools/Sandcastle/Presentation/vs2005/Content/shared_content.xml @@ -65,6 +65,9 @@ <!-- section titles --> <item id="exceptionsTitle">Exceptions</item> + <item id="contractsTitle">Contracts</item> + <item id="setterTitle">Set</item> + <item id="getterTitle">Get</item> <item id="SeeAlso">See Also</item> <item id="SeeAlsoTasks">Tasks</item> <item id="SeeAlsoReference">Reference</item> diff --git a/tools/Sandcastle/Presentation/vs2005/transforms/main_sandcastle.xsl b/tools/Sandcastle/Presentation/vs2005/transforms/main_sandcastle.xsl index 390b798..9954a00 100644 --- a/tools/Sandcastle/Presentation/vs2005/transforms/main_sandcastle.xsl +++ b/tools/Sandcastle/Presentation/vs2005/transforms/main_sandcastle.xsl @@ -1,25 +1,25 @@ <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"> - <!-- stuff specified to comments authored in DDUEXML --> + <!-- stuff specified to comments authored in DDUEXML --> <xsl:param name="omitXmlnsBoilerplate" select="'false'" /> - - <xsl:include href="htmlBody.xsl"/> + + <xsl:include href="htmlBody.xsl"/> <xsl:include href="utilities_reference.xsl" /> - <xsl:variable name="summary" select="normalize-space(/document/comments/summary)" /> + <xsl:variable name="summary" select="normalize-space(/document/comments/summary)" /> <xsl:variable name="abstractSummary" select="/document/comments/summary" /> <xsl:variable name="hasSeeAlsoSection" select="boolean((count(/document/comments//seealso | /document/reference/elements/element/overloads//seealso) > 0) or ($group='type' or $group='member' or $group='list'))"/> <xsl:variable name="examplesSection" select="boolean(string-length(/document/comments/example[normalize-space(.)]) > 0)"/> <xsl:variable name="languageFilterSection" select="boolean(string-length(/document/comments/example[normalize-space(.)]) > 0)" /> - + <xsl:template name="body"> - - <!-- auto-inserted info --> - <!-- <xsl:apply-templates select="/document/reference/attributes" /> --> + + <!-- auto-inserted info --> + <!-- <xsl:apply-templates select="/document/reference/attributes" /> --> <xsl:apply-templates select="/document/comments/preliminary" /> - <xsl:apply-templates select="/document/comments/summary" /> + <xsl:apply-templates select="/document/comments/summary" /> <xsl:if test="$subgroup='overload'"> <xsl:apply-templates select="/document/reference/elements" mode="overloadSummary" /> </xsl:if> @@ -27,72 +27,74 @@ <xsl:if test="not($group='list' or $group='root' or $group='namespace')"> <xsl:call-template name="requirementsInfo"/> </xsl:if> - <!-- syntax --> + <!-- syntax --> <xsl:if test="not($group='list' or $group='namespace')"> <xsl:apply-templates select="/document/syntax" /> </xsl:if> - <!-- members --> - <xsl:choose> - <xsl:when test="$group='root'"> - <xsl:apply-templates select="/document/reference/elements" mode="root" /> - </xsl:when> - <xsl:when test="$group='namespace'"> - <xsl:apply-templates select="/document/reference/elements" mode="namespace" /> - </xsl:when> - <xsl:when test="$subgroup='enumeration'"> - <xsl:apply-templates select="/document/reference/elements" mode="enumeration" /> - </xsl:when> - <xsl:when test="$group='type'"> - <xsl:apply-templates select="/document/reference/elements" mode="type" /> - </xsl:when> - <xsl:when test="$group='list'"> - <xsl:choose> - <xsl:when test="$subgroup='overload'"> - <xsl:apply-templates select="/document/reference/elements" mode="overload" /> - </xsl:when> - <xsl:when test="$subgroup='DerivedTypeList'"> - <xsl:apply-templates select="/document/reference/elements" mode="derivedType" /> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="/document/reference/elements" mode="member" /> - </xsl:otherwise> - </xsl:choose> + <!-- members --> + <xsl:choose> + <xsl:when test="$group='root'"> + <xsl:apply-templates select="/document/reference/elements" mode="root" /> + </xsl:when> + <xsl:when test="$group='namespace'"> + <xsl:apply-templates select="/document/reference/elements" mode="namespace" /> </xsl:when> - </xsl:choose> - <!-- remarks --> - <xsl:apply-templates select="/document/comments/remarks" /> - <!-- example --> - <xsl:apply-templates select="/document/comments/example" /> - <!-- other comment sections --> - <!-- permissions --> + <xsl:when test="$subgroup='enumeration'"> + <xsl:apply-templates select="/document/reference/elements" mode="enumeration" /> + </xsl:when> + <xsl:when test="$group='type'"> + <xsl:apply-templates select="/document/reference/elements" mode="type" /> + </xsl:when> + <xsl:when test="$group='list'"> + <xsl:choose> + <xsl:when test="$subgroup='overload'"> + <xsl:apply-templates select="/document/reference/elements" mode="overload" /> + </xsl:when> + <xsl:when test="$subgroup='DerivedTypeList'"> + <xsl:apply-templates select="/document/reference/elements" mode="derivedType" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="/document/reference/elements" mode="member" /> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + </xsl:choose> + <!-- remarks --> + <xsl:apply-templates select="/document/comments/remarks" /> + <!-- example --> + <xsl:apply-templates select="/document/comments/example" /> + <!-- other comment sections --> + <!-- permissions --> <xsl:call-template name="permissions" /> - <!-- exceptions --> - <xsl:call-template name="exceptions" /> - <!-- inheritance --> - <xsl:apply-templates select="/document/reference/family" /> + <!-- exceptions --> + <xsl:call-template name="exceptions" /> + <!-- contracts --> + <xsl:call-template name="contracts" /> + <!-- inheritance --> + <xsl:apply-templates select="/document/reference/family" /> <xsl:apply-templates select="/document/comments/threadsafety" /> <!--versions--> <xsl:if test="not($group='list' or $group='namespace' or $group='root' )"> <xsl:apply-templates select="/document/reference/versions" /> </xsl:if> - <!-- see also --> + <!-- see also --> <xsl:call-template name="seealso" /> - </xsl:template> + </xsl:template> - <xsl:template name="getParameterDescription"> - <xsl:param name="name" /> - <xsl:apply-templates select="/document/comments/param[@name=$name]" /> - </xsl:template> + <xsl:template name="getParameterDescription"> + <xsl:param name="name" /> + <xsl:apply-templates select="/document/comments/param[@name=$name]" /> + </xsl:template> - <xsl:template name="getReturnsDescription"> - <xsl:param name="name" /> - <xsl:apply-templates select="/document/comments/param[@name=$name]" /> - </xsl:template> + <xsl:template name="getReturnsDescription"> + <xsl:param name="name" /> + <xsl:apply-templates select="/document/comments/param[@name=$name]" /> + </xsl:template> - <xsl:template name="getElementDescription"> - <xsl:apply-templates select="summary[1]" /> - </xsl:template> + <xsl:template name="getElementDescription"> + <xsl:apply-templates select="summary[1]" /> + </xsl:template> <xsl:template name="getOverloadSummary"> <xsl:apply-templates select="overloads" mode="summary"/> @@ -103,28 +105,28 @@ </xsl:template> <xsl:template name="getInternalOnlyDescription"> - + </xsl:template> <!-- block sections --> - <xsl:template match="summary"> - <div class="summary"> - <xsl:apply-templates /> - </div> - </xsl:template> + <xsl:template match="summary"> + <div class="summary"> + <xsl:apply-templates /> + </div> + </xsl:template> <xsl:template match="overloads" mode="summary"> <xsl:choose> - <xsl:when test="count(summary) > 0"> - <xsl:apply-templates select="summary" /> - </xsl:when> - <xsl:otherwise> - <div class="summary"> - <xsl:apply-templates/> - </div> - </xsl:otherwise> + <xsl:when test="count(summary) > 0"> + <xsl:apply-templates select="summary" /> + </xsl:when> + <xsl:otherwise> + <div class="summary"> + <xsl:apply-templates/> + </div> + </xsl:otherwise> </xsl:choose> </xsl:template> @@ -133,7 +135,7 @@ <xsl:apply-templates select="example"/> </xsl:template> - <xsl:template match="value"> + <xsl:template match="value"> <xsl:call-template name="subSection"> <xsl:with-param name="title"> <include item="fieldValueTitle" /> @@ -142,9 +144,9 @@ <xsl:apply-templates /> </xsl:with-param> </xsl:call-template> - </xsl:template> + </xsl:template> - <xsl:template match="returns"> + <xsl:template match="returns"> <xsl:call-template name="subSection"> <xsl:with-param name="title"> <include item="methodValueTitle" /> @@ -179,28 +181,38 @@ </xsl:call-template> </xsl:template> - <xsl:template match="remarks"> - <xsl:call-template name="section"> + <xsl:template match="remarks"> + <xsl:call-template name="section"> <xsl:with-param name="toggleSwitch" select="'remarks'"/> - <xsl:with-param name="title"><include item="remarksTitle" /></xsl:with-param> - <xsl:with-param name="content"><xsl:apply-templates /></xsl:with-param> - </xsl:call-template> - </xsl:template> + <xsl:with-param name="title"> + <include item="remarksTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> + <xsl:apply-templates /> + </xsl:with-param> + </xsl:call-template> + </xsl:template> - <xsl:template match="example"> - <xsl:call-template name="section"> + <xsl:template match="example"> + <xsl:call-template name="section"> <xsl:with-param name="toggleSwitch" select="'example'"/> - <xsl:with-param name="title"><include item="examplesTitle" /></xsl:with-param> - <xsl:with-param name="content"><xsl:apply-templates /></xsl:with-param> - </xsl:call-template> - </xsl:template> + <xsl:with-param name="title"> + <include item="examplesTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> + <xsl:apply-templates /> + </xsl:with-param> + </xsl:call-template> + </xsl:template> - <xsl:template match="para"> - <p><xsl:apply-templates /></p> - </xsl:template> + <xsl:template match="para"> + <p> + <xsl:apply-templates /> + </p> + </xsl:template> + + <xsl:template match="code"> - <xsl:template match="code"> - <xsl:variable name="codeLang"> <xsl:choose> <xsl:when test="@language = 'vbs'"> @@ -243,34 +255,253 @@ <xsl:with-param name="codeLang" select="$codeLang" /> </xsl:call-template> - </xsl:template> + </xsl:template> - <xsl:template name="exceptions"> - <xsl:if test="count(/document/comments/exception) > 0"> - <xsl:call-template name="section"> + <xsl:template name="exceptions"> + <xsl:if test="count(/document/comments/exception) > 0"> + <xsl:call-template name="section"> <xsl:with-param name="toggleSwitch" select="'exceptions'"/> - <xsl:with-param name="title"><include item="exceptionsTitle" /></xsl:with-param> - <xsl:with-param name="content"> + <xsl:with-param name="title"> + <include item="exceptionsTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> <div class="tableSection"> <table width="100%" cellspacing="2" cellpadding="5" frame="lhs" > - <tr> - <th class="exceptionNameColumn"><include item="exceptionNameHeader" /></th> - <th class="exceptionConditionColumn"><include item="exceptionConditionHeader" /></th> - </tr> - <xsl:for-each select="/document/comments/exception"> - <tr> - <td><referenceLink target="{@cref}" qualified="true" /></td> - <td> - <xsl:apply-templates select="." /> - </td> - </tr> - </xsl:for-each> - </table> + <tr> + <th class="exceptionNameColumn"> + <include item="exceptionNameHeader" /> + </th> + <th class="exceptionConditionColumn"> + <include item="exceptionConditionHeader" /> + </th> + </tr> + <xsl:for-each select="/document/comments/exception"> + <tr> + <td> + <referenceLink target="{@cref}" qualified="true" /> + </td> + <td> + <xsl:apply-templates select="." /> + </td> + </tr> + </xsl:for-each> + </table> + </div> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template name="contracts"> + <xsl:variable name="requires" select="/document/comments/requires" /> + <xsl:variable name="ensures" select="/document/comments/ensures" /> + <xsl:variable name="ensuresOnThrow" select="/document/comments/ensuresOnThrow" /> + <xsl:variable name="invariants" select="/document/comments/invariant" /> + <xsl:variable name="setter" select="/document/comments/setter" /> + <xsl:variable name="getter" select="/document/comments/getter" /> + <xsl:variable name="pure" select="/document/comments/pure" /> + <xsl:if test="$requires or $ensures or $ensuresOnThrow or $invariants or $setter or $getter or $pure"> + <xsl:call-template name="section"> + <xsl:with-param name="toggleSwitch" select="'contracts'"/> + <xsl:with-param name="title"> + <include item="contractsTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> + <!--Purity--> + <xsl:if test="$pure"> + <xsl:text>This method is pure.</xsl:text> + </xsl:if> + <!--Contracts--> + <div class="tableSection"> + <xsl:if test="$getter"> + <xsl:variable name="getterRequires" select="$getter/requires"/> + <xsl:variable name="getterEnsures" select="$getter/ensures"/> + <xsl:variable name="getterEnsuresOnThrow" select="$getter/ensuresOnThrow"/> + <xsl:call-template name="subSection"> + <xsl:with-param name="title"> + <include item="getterTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> + <xsl:if test="$getterRequires"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="requiresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$getterRequires"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$getterEnsures"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$getterEnsures"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$getterEnsuresOnThrow"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresOnThrowNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$getterEnsuresOnThrow"/> + </xsl:call-template> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="$setter"> + <xsl:variable name="setterRequires" select="$setter/requires"/> + <xsl:variable name="setterEnsures" select="$setter/ensures"/> + <xsl:variable name="setterEnsuresOnThrow" select="$setter/ensuresOnThrow"/> + <xsl:call-template name="subSection"> + <xsl:with-param name="title"> + <include item="setterTitle" /> + </xsl:with-param> + <xsl:with-param name="content"> + <xsl:if test="$setterRequires"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="requiresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$setterRequires"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$setterEnsures"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$setterEnsures"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$setterEnsuresOnThrow"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresOnThrowNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$setterEnsuresOnThrow"/> + </xsl:call-template> + </xsl:if> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:if test="$requires"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="requiresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$requires"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$ensures"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$ensures"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$ensuresOnThrow"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="ensuresOnThrowNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$ensuresOnThrow"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="$invariants"> + <xsl:call-template name="contractsTable"> + <xsl:with-param name="title"> + <include item="invariantsNameHeader"/> + </xsl:with-param> + <xsl:with-param name="contracts" select="$invariants"/> + </xsl:call-template> + </xsl:if> + </div> + <!--Contracts link--> + <div class="contractsLink"> + <a> + <xsl:attribute name="target"> + <xsl:text>_blank</xsl:text> + </xsl:attribute> + <xsl:attribute name="href"> + <xsl:text>http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx</xsl:text> + </xsl:attribute> + <xsl:text>Learn more about contracts</xsl:text> + </a> </div> - </xsl:with-param> - </xsl:call-template> - </xsl:if> - </xsl:template> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <xsl:template name="contractsTable"> + <xsl:param name="title"/> + <xsl:param name="contracts"/> + <table width="100%" cellspacing="3" cellpadding="5" frame="lhs" > + <tr> + <th class="contractsNameColumn"> + <xsl:copy-of select="$title"/> + </th> + </tr> + <xsl:for-each select="$contracts"> + <tr> + <td> + <div class="code" style="margin-bottom: 0pt; white-space: pre-wrap;"> + <pre style="margin-bottom: 0pt"> + <xsl:value-of select="."/> + </pre> + </div> + <xsl:if test="@description or @inheritedFrom or @exception"> + <div style="font-size:95%; margin-left: 10pt; + margin-bottom: 0pt"> + <table + class="contractaux" + width="100%" frame="void" rules="none" border="0"> + <colgroup> + <col width="10%"/> + <col width="90%"/> + </colgroup> + <xsl:if test="@description"> + <tr style="border-bottom: 0px none;"> + <td style="border-bottom: 0px none;"> + <i><xsl:text>Description: </xsl:text></i> + </td> + <td style="border-bottom: 0px none;"> + <xsl:value-of select="@description"/> + </td> + </tr> + </xsl:if> + <xsl:if test="@inheritedFrom"> + <tr style="border-bottom: 0px none;"> + <td style="border-bottom: 0px none;"> + <i><xsl:text>Inherited From: </xsl:text></i> + </td> + <td style="border-bottom: 0px none;"> + <referenceLink target="{@inheritedFrom}"> + <xsl:value-of select="@inheritedFromTypeName"/> + </referenceLink> + </td> + </tr> + </xsl:if> + <xsl:if test="@exception"> + <tr style="border-bottom: 0px none;"> + <td style="border-bottom: 0px none;"> + <i><xsl:text>Exception: </xsl:text></i> + </td> + <td style="border-bottom: 0px none;"> + <referenceLink target="{@exception}" qualified="true" /> + </td> + </tr> + </xsl:if> + </table> + </div> + </xsl:if> + </td> + </tr> + </xsl:for-each> + </table> + </xsl:template> <xsl:template name="permissions"> <xsl:if test="count(/document/comments/permission) > 0"> @@ -282,25 +513,25 @@ <xsl:with-param name="content"> <div class="tableSection"> <table width="100%" cellspacing="2" cellpadding="5" frame="lhs" > - <tr> - <th class="permissionNameColumn"> - <include item="permissionNameHeader" /> - </th> - <th class="permissionDescriptionColumn"> - <include item="permissionDescriptionHeader" /> - </th> - </tr> - <xsl:for-each select="/document/comments/permission"> <tr> - <td> - <referenceLink target="{@cref}" qualified="true" /> - </td> - <td> - <xsl:apply-templates select="." /> - </td> + <th class="permissionNameColumn"> + <include item="permissionNameHeader" /> + </th> + <th class="permissionDescriptionColumn"> + <include item="permissionDescriptionHeader" /> + </th> </tr> - </xsl:for-each> - </table> + <xsl:for-each select="/document/comments/permission"> + <tr> + <td> + <referenceLink target="{@cref}" qualified="true" /> + </td> + <td> + <xsl:apply-templates select="." /> + </td> + </tr> + </xsl:for-each> + </table> </div> </xsl:with-param> </xsl:call-template> @@ -308,7 +539,7 @@ </xsl:template> <xsl:template name="seealso"> - <xsl:if test="$hasSeeAlsoSection"> + <xsl:if test="$hasSeeAlsoSection"> <xsl:call-template name="section"> <xsl:with-param name="toggleSwitch" select="'seeAlso'" /> <xsl:with-param name="title"> @@ -316,7 +547,7 @@ </xsl:with-param> <xsl:with-param name="content"> <xsl:call-template name="autogenSeeAlsoLinks"/> - <xsl:for-each select="/document/comments//seealso | /document/reference/elements/element/overloads//seealso"> + <xsl:for-each select="/document/comments//seealso | /document/reference/elements/element/overloads//seealso"> <div class="seeAlsoStyle"> <xsl:apply-templates select="."> <xsl:with-param name="displaySeeAlso" select="true()" /> @@ -328,46 +559,52 @@ </xsl:if> </xsl:template> - <xsl:template match="list[@type='bullet']"> - <ul> - <xsl:for-each select="item"> - <li><xsl:apply-templates /></li> - </xsl:for-each> - </ul> - </xsl:template> + <xsl:template match="list[@type='bullet']"> + <ul> + <xsl:for-each select="item"> + <li> + <xsl:apply-templates /> + </li> + </xsl:for-each> + </ul> + </xsl:template> - <xsl:template match="list[@type='number']"> - <ol> - <xsl:for-each select="item"> - <li><xsl:apply-templates /></li> - </xsl:for-each> - </ol> - </xsl:template> + <xsl:template match="list[@type='number']"> + <ol> + <xsl:for-each select="item"> + <li> + <xsl:apply-templates /> + </li> + </xsl:for-each> + </ol> + </xsl:template> - <xsl:template match="list[@type='table']"> + <xsl:template match="list[@type='table']"> <div class="tableSection"> <table width="100%" cellspacing="2" cellpadding="5" frame="lhs" > - <xsl:for-each select="listheader"> - <tr> - <xsl:for-each select="*"> - <th><xsl:apply-templates /></th> - </xsl:for-each> - </tr> - </xsl:for-each> - <xsl:for-each select="item"> - <tr> - <xsl:for-each select="*"> - <td> - <xsl:apply-templates /> - </td> - </xsl:for-each> - </tr> - </xsl:for-each> - </table> + <xsl:for-each select="listheader"> + <tr> + <xsl:for-each select="*"> + <th> + <xsl:apply-templates /> + </th> + </xsl:for-each> + </tr> + </xsl:for-each> + <xsl:for-each select="item"> + <tr> + <xsl:for-each select="*"> + <td> + <xsl:apply-templates /> + </td> + </xsl:for-each> + </tr> + </xsl:for-each> + </table> </div> - </xsl:template> + </xsl:template> - <!-- inline tags --> + <!-- inline tags --> <xsl:template match="see[@cref]"> <xsl:choose> @@ -386,13 +623,17 @@ <xsl:choose> <xsl:when test="normalize-space(.)"> <a> - <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute> + <xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute> <xsl:value-of select="." /> </a> </xsl:when> <xsl:otherwise> <a> - <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute> + <xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute> <xsl:value-of select="@href" /> </a> </xsl:otherwise> @@ -402,20 +643,24 @@ <xsl:template match="seealso[@href]"> <xsl:param name="displaySeeAlso" select="false()" /> <xsl:if test="$displaySeeAlso"> - <xsl:choose> - <xsl:when test="normalize-space(.)"> - <a> - <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute> - <xsl:value-of select="." /> - </a> - </xsl:when> - <xsl:otherwise> - <a> - <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute> - <xsl:value-of select="@href" /> - </a> - </xsl:otherwise> - </xsl:choose> + <xsl:choose> + <xsl:when test="normalize-space(.)"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute> + <xsl:value-of select="." /> + </a> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="@href"/> + </xsl:attribute> + <xsl:value-of select="@href" /> + </a> + </xsl:otherwise> + </xsl:choose> </xsl:if> </xsl:template> @@ -424,37 +669,37 @@ <xsl:choose> <xsl:when test="@langword='null' or @langword='Nothing' or @langword='nullptr'"> <span class="languageSpecificText"> - <span class="cs">null</span> - <span class="vb">Nothing</span> - <span class="cpp">nullptr</span> + <span class="cs">null</span> + <span class="vb">Nothing</span> + <span class="cpp">nullptr</span> </span> </xsl:when> <xsl:when test="@langword='static' or @langword='Shared'"> <span class="languageSpecificText"> - <span class="cs">static</span> - <span class="vb">Shared</span> - <span class="cpp">static</span> + <span class="cs">static</span> + <span class="vb">Shared</span> + <span class="cpp">static</span> </span> </xsl:when> <xsl:when test="@langword='virtual' or @langword='Overridable'"> <span class="languageSpecificText"> - <span class="cs">virtual</span> - <span class="vb">Overridable</span> - <span class="cpp">virtual</span> + <span class="cs">virtual</span> + <span class="vb">Overridable</span> + <span class="cpp">virtual</span> </span> </xsl:when> <xsl:when test="@langword='true' or @langword='True'"> <span class="languageSpecificText"> - <span class="cs">true</span> - <span class="vb">True</span> - <span class="cpp">true</span> + <span class="cs">true</span> + <span class="vb">True</span> + <span class="cpp">true</span> </span> </xsl:when> <xsl:when test="@langword='false' or @langword='False'"> <span class="languageSpecificText"> - <span class="cs">false</span> - <span class="vb">False</span> - <span class="cpp">false</span> + <span class="cs">false</span> + <span class="vb">False</span> + <span class="cpp">false</span> </span> </xsl:when> <xsl:when test="@langword='abstract'"> @@ -471,45 +716,59 @@ </span> <xsl:choose> <xsl:when test="@langword='null' or @langword='Nothing' or @langword='nullptr'"> - <span class="nu"><include item="nullKeyword"/></span> + <span class="nu"> + <include item="nullKeyword"/> + </span> </xsl:when> <xsl:when test="@langword='static' or @langword='Shared'"> - <span class="nu"><include item="staticKeyword"/></span> + <span class="nu"> + <include item="staticKeyword"/> + </span> </xsl:when> <xsl:when test="@langword='virtual' or @langword='Overridable'"> - <span class="nu"><include item="virtualKeyword"/></span> + <span class="nu"> + <include item="virtualKeyword"/> + </span> </xsl:when> <xsl:when test="@langword='true' or @langword='True'"> - <span class="nu"><include item="trueKeyword"/></span> + <span class="nu"> + <include item="trueKeyword"/> + </span> </xsl:when> <xsl:when test="@langword='false' or @langword='False'"> - <span class="nu"><include item="falseKeyword"/></span> + <span class="nu"> + <include item="falseKeyword"/> + </span> </xsl:when> <xsl:when test="@langword='abstract'"> - <span class="nu"><include item="abstractKeyword"/></span> + <span class="nu"> + <include item="abstractKeyword"/> + </span> </xsl:when> </xsl:choose> - + </xsl:template> <xsl:template match="seealso"> <xsl:param name="displaySeeAlso" select="false()" /> <xsl:if test="$displaySeeAlso"> - <xsl:choose> - <xsl:when test="normalize-space(.)"> - <referenceLink target="{@cref}" qualified="true"> - <xsl:value-of select="." /> - </referenceLink> - </xsl:when> - <xsl:otherwise> - <referenceLink target="{@cref}" qualified="true" /> - </xsl:otherwise> - </xsl:choose> + <xsl:choose> + <xsl:when test="normalize-space(.)"> + <referenceLink target="{@cref}" qualified="true"> + <xsl:value-of select="." /> + </referenceLink> + </xsl:when> + <xsl:otherwise> + <referenceLink target="{@cref}" qualified="true" /> + </xsl:otherwise> + </xsl:choose> </xsl:if> </xsl:template> <xsl:template match="c"> - <span class="code"><xsl:apply-templates/></span> + <span class="code"> + <xsl:apply-templates/> + </span> </xsl:template> <xsl:template match="paramref"> @@ -550,14 +809,14 @@ <include item="runningHeaderText" /> </xsl:template> - <!-- pass through html tags --> + <!-- pass through html tags --> - <xsl:template match="p|ol|ul|li|dl|dt|dd|table|tr|th|td|a|img|b|i|strong|em|del|sub|sup|br|hr|h1|h2|h3|h4|h5|h6|pre|div|span|blockquote|abbr|acronym|u|font|map|area"> - <xsl:copy> - <xsl:copy-of select="@*" /> - <xsl:apply-templates /> - </xsl:copy> - </xsl:template> + <xsl:template match="p|ol|ul|li|dl|dt|dd|table|tr|th|td|a|img|b|i|strong|em|del|sub|sup|br|hr|h1|h2|h3|h4|h5|h6|pre|div|span|blockquote|abbr|acronym|u|font|map|area"> + <xsl:copy> + <xsl:copy-of select="@*" /> + <xsl:apply-templates /> + </xsl:copy> + </xsl:template> <!-- extra tag support --> @@ -612,40 +871,40 @@ </div> </xsl:template> - <!-- move these off into a shared file --> + <!-- move these off into a shared file --> <xsl:template name="createReferenceLink"> <xsl:param name="id" /> <xsl:param name="qualified" select="false()" /> - - <referenceLink target="{$id}" qualified="{$qualified}" /> - + + <referenceLink target="{$id}" qualified="{$qualified}" /> + </xsl:template> - - <xsl:template name="section"> + + <xsl:template name="section"> <xsl:param name="toggleSwitch" /> - <xsl:param name="title" /> - <xsl:param name="content" /> - + <xsl:param name="title" /> + <xsl:param name="content" /> + <xsl:variable name="toggleTitle" select="concat($toggleSwitch,'Toggle')" /> <xsl:variable name="toggleSection" select="concat($toggleSwitch,'Section')" /> - - <h1 class="heading"> - <span onclick="ExpandCollapse({$toggleTitle})" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey({$toggleTitle}, event)" tabindex="0"> - <img id="{$toggleTitle}" class="toggle" name="toggleSwitch"> - <includeAttribute name="src" item="iconPath"> - <parameter>collapse_all.gif</parameter> - </includeAttribute> - </img> - <xsl:copy-of select="$title" /> - </span> - </h1> - + + <h1 class="heading"> + <span onclick="ExpandCollapse({$toggleTitle})" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey({$toggleTitle}, event)" tabindex="0"> + <img id="{$toggleTitle}" class="toggle" name="toggleSwitch"> + <includeAttribute name="src" item="iconPath"> + <parameter>collapse_all.gif</parameter> + </includeAttribute> + </img> + <xsl:copy-of select="$title" /> + </span> + </h1> + <div id="{$toggleSection}" class="section" name="collapseableSection" style=""> <xsl:copy-of select="$content" /> </div> - - </xsl:template> + + </xsl:template> <xsl:template name="subSection"> <xsl:param name="title" /> @@ -655,7 +914,7 @@ <xsl:copy-of select="$title" /> </h4> <xsl:copy-of select="$content" /> - + </xsl:template> <xsl:template name="memberIntro"> @@ -687,7 +946,7 @@ <includeAttribute name="title" item="footerImage" /> </img> </div> - + <include item="footer"> <parameter> <xsl:value-of select="$key"/> |