1 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
|
---|
2 | xmlns:MSHelp="http://msdn.microsoft.com/mshelp"
|
---|
3 | xmlns:mshelp="http://msdn.microsoft.com/mshelp"
|
---|
4 | xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5"
|
---|
5 | xmlns:xlink="http://www.w3.org/1999/xlink"
|
---|
6 | xmlns:msxsl="urn:schemas-microsoft-com:xslt"
|
---|
7 | >
|
---|
8 |
|
---|
9 | <msxsl:script language="C#" implements-prefix="ddue">
|
---|
10 | <msxsl:using namespace="System" />
|
---|
11 | <msxsl:using namespace="System.Globalization"/>
|
---|
12 | <msxsl:using namespace="System.Text.RegularExpressions" />
|
---|
13 | <![CDATA[
|
---|
14 | public static string ToUpper(string id) {
|
---|
15 | return id.Trim().ToUpper(System.Globalization.CultureInfo.InvariantCulture);
|
---|
16 | }
|
---|
17 | //Regular expression to check that a string is in a valid Guid representation.
|
---|
18 | private static Regex guidChecker = new Regex("[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}", RegexOptions.None);
|
---|
19 |
|
---|
20 | public static string GuidChecker(string id) {
|
---|
21 | return guidChecker.IsMatch(id).ToString();
|
---|
22 | }
|
---|
23 |
|
---|
24 | public static string CompareDate(string RTMReleaseDate, string changedHistoryDate) {
|
---|
25 |
|
---|
26 | CultureInfo culture = CultureInfo.InvariantCulture;
|
---|
27 | DateTime dt1 = DateTime.MinValue;
|
---|
28 | DateTime dt2 = DateTime.MinValue;
|
---|
29 |
|
---|
30 | try {
|
---|
31 | dt1 = DateTime.Parse(RTMReleaseDate, culture);
|
---|
32 | }
|
---|
33 | catch (FormatException) {
|
---|
34 | Console.WriteLine(string.Format("Error: CompareDate: Unable to convert '{0}' for culture {1}.", RTMReleaseDate, culture.Name));
|
---|
35 | return "notValidDate";
|
---|
36 | }
|
---|
37 |
|
---|
38 | try {
|
---|
39 | dt2 = DateTime.Parse(changedHistoryDate,culture);
|
---|
40 | }
|
---|
41 | catch (FormatException) {
|
---|
42 | Console.WriteLine(string.Format("Error: CompareDate: Unable to convert '{0}' for culture {1}.", changedHistoryDate, culture.Name));
|
---|
43 | return "notValidDate";
|
---|
44 | }
|
---|
45 |
|
---|
46 | if (DateTime.Compare(dt2, dt1) > 0) return changedHistoryDate;
|
---|
47 | else return RTMReleaseDate;
|
---|
48 | }
|
---|
49 |
|
---|
50 | ]]>
|
---|
51 | </msxsl:script>
|
---|
52 |
|
---|
53 | <!-- Tasks -->
|
---|
54 | <xsl:variable name="HowTo" select="'DAC3A6A0-C863-4E5B-8F65-79EFC6A4BA09'" />
|
---|
55 | <xsl:variable name="Walkthrough" select="'4779DD54-5D0C-4CC3-9DB3-BF1C90B721B3'" />
|
---|
56 | <xsl:variable name="Sample" select="'069EFD88-412D-4E2F-8848-2D5C3AD56BDE'" />
|
---|
57 | <xsl:variable name="Troubleshooting" select="'38C8E0D1-D601-4DBA-AE1B-5BEC16CD9B01'" />
|
---|
58 |
|
---|
59 | <!-- Reference -->
|
---|
60 | <xsl:variable name="ReferenceWithoutSyntax" select="'F9205737-4DEC-4A58-AA69-0E621B1236BD'" />
|
---|
61 | <xsl:variable name="ReferenceWithSyntax" select="'95DADC4C-A2A6-447A-AA36-B6BE3A4F8DEC'" />
|
---|
62 | <xsl:variable name="XMLReference" select="'3272D745-2FFC-48C4-9E9D-CF2B2B784D5F'" />
|
---|
63 | <xsl:variable name="ErrorMessage" select="'A635375F-98C2-4241-94E7-E427B47C20B6'" />
|
---|
64 | <xsl:variable name="UIReference" select="'B8ED9F21-39A4-4967-928D-160CD2ED9DCE'" />
|
---|
65 |
|
---|
66 | <!-- Concepts -->
|
---|
67 | <xsl:variable name="Conceptual" select="'1FE70836-AA7D-4515-B54B-E10C4B516E50'" />
|
---|
68 | <xsl:variable name="SDKTechnologyOverviewArchitecture" select="'68F07632-C4C5-4645-8DFA-AC87DCB4BD54'" />
|
---|
69 | <xsl:variable name="SDKTechnologyOverviewCodeDirectory" select="'4BBAAF90-0E5F-4C86-9D31-A5CAEE35A416'" />
|
---|
70 | <xsl:variable name="SDKTechnologyOverviewScenarios" select="'356C57C4-384D-4AF2-A637-FDD6F088A033'" />
|
---|
71 | <xsl:variable name="SDKTechnologyOverviewTechnologySummary" select="'19F1BB0E-F32A-4D5F-80A9-211D92A8A715'" />
|
---|
72 |
|
---|
73 | <!-- Other Resources -->
|
---|
74 | <xsl:variable name="Orientation" select="'B137C930-7BF7-48A2-A329-3ADCAEF8868E'" />
|
---|
75 | <xsl:variable name="WhitePaper" select="'56DB00EC-28BA-4C0D-8694-28E8B244E236'" />
|
---|
76 | <xsl:variable name="CodeEntity" select="'4A273212-0AC8-4D72-8349-EC11CD2FF8CD'" />
|
---|
77 | <xsl:variable name="Glossary" select="'A689E19C-2687-4881-8CE1-652FF60CF46C'" />
|
---|
78 | <xsl:variable name="SDKTechnologyOverviewOrientation" select="'CDB8C120-888F-447B-8AF8-F9540562E7CA'" />
|
---|
79 |
|
---|
80 | <xsl:template match="ddue:relatedTopics" mode="seeAlso">
|
---|
81 | <xsl:param name="autoGenerateLinks" select="'false'" />
|
---|
82 |
|
---|
83 | <xsl:if test="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) = $HowTo or ddue:ToUpper(@topicType_id) = $Walkthrough or ddue:ToUpper(@topicType_id) = $Sample or ddue:ToUpper(@topicType_id) = $Troubleshooting) and ddue:GuidChecker(@xlink:href) = 'True']" >
|
---|
84 | <xsl:call-template name="seeAlsoSubSection">
|
---|
85 | <xsl:with-param name="headerGroup" select="'SeeAlsoTasks'" />
|
---|
86 | <xsl:with-param name="members" select="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) = $HowTo or ddue:ToUpper(@topicType_id) = $Walkthrough or ddue:ToUpper(@topicType_id) = $Sample or ddue:ToUpper(@topicType_id) = $Troubleshooting) and ddue:GuidChecker(@xlink:href) = 'True']" />
|
---|
87 | <xsl:with-param name="autoGenerateLinks" select="'false'" />
|
---|
88 | </xsl:call-template>
|
---|
89 | </xsl:if>
|
---|
90 |
|
---|
91 | <xsl:if test="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) = $Conceptual or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewArchitecture or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewCodeDirectory or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewScenarios or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewTechnologySummary) and ddue:GuidChecker(@xlink:href) = 'True']">
|
---|
92 | <xsl:call-template name="seeAlsoSubSection">
|
---|
93 | <xsl:with-param name="headerGroup" select="'SeeAlsoConcepts'" />
|
---|
94 | <xsl:with-param name="members" select="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) = $Conceptual or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewArchitecture or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewCodeDirectory or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewScenarios or ddue:ToUpper(@topicType_id) = $SDKTechnologyOverviewTechnologySummary) and ddue:GuidChecker(@xlink:href) = 'True']" />
|
---|
95 | <xsl:with-param name="autoGenerateLinks" select="'false'" />
|
---|
96 | </xsl:call-template>
|
---|
97 | </xsl:if>
|
---|
98 |
|
---|
99 | <xsl:if test="(ddue:link | ddue:legacyLink)[((ddue:ToUpper(@topicType_id) = $ReferenceWithoutSyntax or ddue:ToUpper(@topicType_id) = $ReferenceWithSyntax or ddue:ToUpper(@topicType_id) = $XMLReference or ddue:ToUpper(@topicType_id) = $ErrorMessage or ddue:ToUpper(@topicType_id) = $UIReference) and ddue:GuidChecker(@xlink:href) = 'True') or ddue:GuidChecker(@xlink:href) = 'False'] |
|
---|
100 | ddue:codeEntityReference or
|
---|
101 | $autoGenerateLinks = 'true'">
|
---|
102 | <xsl:call-template name="seeAlsoSubSection">
|
---|
103 | <xsl:with-param name="headerGroup" select="'SeeAlsoReference'" />
|
---|
104 | <xsl:with-param name="members" select="(ddue:link | ddue:legacyLink)[((ddue:ToUpper(@topicType_id) = $ReferenceWithoutSyntax or ddue:ToUpper(@topicType_id) = $ReferenceWithSyntax or ddue:ToUpper(@topicType_id) = $XMLReference or ddue:ToUpper(@topicType_id) = $ErrorMessage or ddue:ToUpper(@topicType_id) = $UIReference) and ddue:GuidChecker(@xlink:href) = 'True') or ddue:GuidChecker(@xlink:href) = 'False'] |
|
---|
105 | ddue:codeEntityReference" />
|
---|
106 | <xsl:with-param name="autoGenerateLinks" select="$autoGenerateLinks" />
|
---|
107 | </xsl:call-template>
|
---|
108 | </xsl:if>
|
---|
109 |
|
---|
110 | <xsl:if test="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) != $HowTo and ddue:ToUpper(@topicType_id) != $Walkthrough and ddue:ToUpper(@topicType_id) != $Sample and ddue:ToUpper(@topicType_id) != $Troubleshooting and ddue:ToUpper(@topicType_id) != $Conceptual and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewArchitecture and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewCodeDirectory and
|
---|
111 | ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewScenarios and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewTechnologySummary and ddue:ToUpper(@topicType_id) != $ReferenceWithoutSyntax and ddue:ToUpper(@topicType_id) != $ReferenceWithSyntax and ddue:ToUpper(@topicType_id) != $XMLReference and ddue:ToUpper(@topicType_id) != $ErrorMessage and ddue:ToUpper(@topicType_id) != $UIReference and
|
---|
112 | ddue:GuidChecker(@xlink:href) = 'True') or (not(@topicType_id) and ddue:GuidChecker(@xlink:href) = 'True')] or
|
---|
113 | ddue:dynamicLink[@type = 'inline'] or
|
---|
114 | ddue:externalLink" >
|
---|
115 | <xsl:call-template name="seeAlsoSubSection">
|
---|
116 | <xsl:with-param name="headerGroup" select="'SeeAlsoOtherResources'" />
|
---|
117 | <xsl:with-param name="members" select="(ddue:link | ddue:legacyLink)[(ddue:ToUpper(@topicType_id) != $HowTo and ddue:ToUpper(@topicType_id) != $Walkthrough and ddue:ToUpper(@topicType_id) != $Sample and ddue:ToUpper(@topicType_id) != $Troubleshooting and ddue:ToUpper(@topicType_id) != $Conceptual and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewArchitecture and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewCodeDirectory and
|
---|
118 | ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewScenarios and ddue:ToUpper(@topicType_id) != $SDKTechnologyOverviewTechnologySummary and ddue:ToUpper(@topicType_id) != $ReferenceWithoutSyntax and ddue:ToUpper(@topicType_id) != $ReferenceWithSyntax and ddue:ToUpper(@topicType_id) != $XMLReference and ddue:ToUpper(@topicType_id) != $ErrorMessage and ddue:ToUpper(@topicType_id) != $UIReference and
|
---|
119 | ddue:GuidChecker(@xlink:href) = 'True') or (not(@topicType_id) and ddue:GuidChecker(@xlink:href) = 'True')] |
|
---|
120 | ddue:dynamicLink[@type = 'inline'] |
|
---|
121 | ddue:externalLink" />
|
---|
122 | <xsl:with-param name="autoGenerateLinks" select="'false'" />
|
---|
123 | </xsl:call-template>
|
---|
124 | </xsl:if>
|
---|
125 |
|
---|
126 | </xsl:template>
|
---|
127 |
|
---|
128 | <xsl:template name="seeAlsoSubSection">
|
---|
129 | <xsl:param name="headerGroup" />
|
---|
130 | <xsl:param name="members" />
|
---|
131 | <xsl:param name="autoGenerateLinks" />
|
---|
132 | <xsl:call-template name="subSection">
|
---|
133 | <xsl:with-param name="title">
|
---|
134 | <include item="{$headerGroup}"/>
|
---|
135 | </xsl:with-param>
|
---|
136 | <xsl:with-param name="content">
|
---|
137 | <xsl:if test="$autoGenerateLinks='true'">
|
---|
138 | <xsl:call-template name="autogenSeeAlsoLinks"/>
|
---|
139 | </xsl:if>
|
---|
140 | <xsl:for-each select="$members">
|
---|
141 | <div class="seeAlsoStyle">
|
---|
142 | <xsl:apply-templates select="." />
|
---|
143 | </div>
|
---|
144 | </xsl:for-each>
|
---|
145 | </xsl:with-param>
|
---|
146 | </xsl:call-template>
|
---|
147 | </xsl:template>
|
---|
148 | </xsl:stylesheet>
|
---|