summaryrefslogtreecommitdiffstats
path: root/tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-08-30 17:09:22 -0700
committerAndrew <andrewarnott@gmail.com>2008-08-30 17:09:22 -0700
commit4a94bcfb7963abcbf602dfa1e1ea9b894985668f (patch)
tree95ef3746ecf0f87abb658db36f113c3baf680be5 /tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl
downloadDotNetOpenAuth-4a94bcfb7963abcbf602dfa1e1ea9b894985668f.zip
DotNetOpenAuth-4a94bcfb7963abcbf602dfa1e1ea9b894985668f.tar.gz
DotNetOpenAuth-4a94bcfb7963abcbf602dfa1e1ea9b894985668f.tar.bz2
Initial build system version.
Diffstat (limited to 'tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl')
-rw-r--r--tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl87
1 files changed, 87 insertions, 0 deletions
diff --git a/tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl b/tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl
new file mode 100644
index 0000000..c375c78
--- /dev/null
+++ b/tools/Sandcastle/ProductionTransforms/FixScriptSharp.xsl
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+
+ <xsl:output indent="yes" encoding="UTF-8" />
+
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- Fix subgroups for enumerations -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.Enum']/apidata/@subgroup">
+ <xsl:attribute name="subgroup">
+ <xsl:value-of select="'enumeration'"/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- Strip ancestors from enumerations -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.Enum']/family">
+ </xsl:template>
+
+ <!-- Strip invalid members from enumerations -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.Enum']/elements">
+ <elements>
+ <xsl:for-each select="element">
+ <xsl:if test="(starts-with(@api, 'F:') and not(contains(@api, 'value__')))">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @*" />
+ </xsl:copy>
+ </xsl:if>
+ </xsl:for-each>
+ </elements>
+ </xsl:template>
+
+ <!-- Fix subgroups for enumerations -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.MulticastDelegate']/apidata/@subgroup">
+ <xsl:attribute name="subgroup">
+ <xsl:value-of select="'delegate'"/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- Strip ancestors from delegates -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.MulticastDelegate']/family">
+ </xsl:template>
+
+ <!-- Strip elements from delegates -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.MulticastDelegate']/elements">
+ </xsl:template>
+
+ <!-- Insert parameters into delegates -->
+ <xsl:template match="reflection/apis/api[apidata/@group='type' and family/ancestors/type/@api='T:System.MulticastDelegate']/apidata">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @*" />
+ </xsl:copy>
+ <xsl:variable name="id" select="../@id" />
+ <xsl:copy-of select="/reflection/apis/api[starts-with(@id, concat('M:', substring-after($id, 'T:'), '.Invoke('))]/parameters">
+ </xsl:copy-of>
+ </xsl:template>
+
+ <!-- Annotate members whose types have the GlobalMethodsAttribute -->
+ <xsl:template match="reflection/apis/api[apidata/@group='member']/apidata/@name">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @*" />
+ </xsl:copy>
+ <xsl:variable name="type" select="../../containers/type/@api" />
+ <xsl:if test="/reflection/apis/api[@id=$type]/attributes/attribute/type/@api='T:System.GlobalMethodsAttribute'">
+ <xsl:attribute name="global">
+ <xsl:value-of select="'true'"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Annotate constructors whose types have the RecordAttribute -->
+ <xsl:template match="reflection/apis/api[apidata/@group='member']/apidata[@subgroup='constructor']/@subgroup">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @*" />
+ </xsl:copy>
+ <xsl:variable name="type" select="../../containers/type/@api" />
+ <xsl:if test="/reflection/apis/api[@id=$type]/attributes/attribute/type/@api='T:System.RecordAttribute'">
+ <xsl:attribute name="record">
+ <xsl:value-of select="'true'"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file