PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/_UpgradeReport_Files/UpgradeReport.xslt

#
Extensible Stylesheet Language Transformations | 232 lines | 204 code | 28 blank | 0 comment | 0 complexity | 6dec1471ffd0592a32e3062956ee8067 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
  3. <xsl:key name="ProjectKey" match="Event" use="@Project" />
  4. <xsl:template match="Events" mode="createProjects">
  5. <projects>
  6. <xsl:for-each select="Event">
  7. <!--xsl:sort select="@Project" order="descending"/-->
  8. <xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
  9. <xsl:variable name="ProjectName" select="@Project"/>
  10. <project>
  11. <xsl:attribute name="name">
  12. <xsl:value-of select="@Project"/>
  13. </xsl:attribute>
  14. <xsl:if test="@Project=''">
  15. <xsl:attribute name="solution">
  16. <xsl:value-of select="@Solution"/>
  17. </xsl:attribute>
  18. </xsl:if>
  19. <xsl:for-each select="key('ProjectKey', $ProjectName)">
  20. <!--xsl:sort select="@Source" /-->
  21. <xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
  22. <source>
  23. <xsl:attribute name="name">
  24. <xsl:value-of select="@Source"/>
  25. </xsl:attribute>
  26. <xsl:variable name="Source">
  27. <xsl:value-of select="@Source"/>
  28. </xsl:variable>
  29. <xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
  30. <event>
  31. <xsl:attribute name="error-level">
  32. <xsl:value-of select="@ErrorLevel"/>
  33. </xsl:attribute>
  34. <xsl:attribute name="description">
  35. <xsl:value-of select="@Description"/>
  36. </xsl:attribute>
  37. </event>
  38. </xsl:for-each>
  39. </source>
  40. </xsl:if>
  41. </xsl:for-each>
  42. </project>
  43. </xsl:if>
  44. </xsl:for-each>
  45. </projects>
  46. </xsl:template>
  47. <xsl:template match="projects">
  48. <xsl:for-each select="project">
  49. <xsl:sort select="@Name" order="ascending"/>
  50. <h2>
  51. <xsl:if test="@solution"><a _locID="Solution">Solution</a>: <xsl:value-of select="@solution"/></xsl:if>
  52. <xsl:if test="not(@solution)"><a _locID="Project">Project</a>: <xsl:value-of select="@name"/>
  53. <xsl:for-each select="source">
  54. <xsl:variable name="Hyperlink" select="@name"/>
  55. <xsl:for-each select="event[@error-level='4']">
  56. &#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
  57. </xsl:for-each>
  58. </xsl:for-each>
  59. </xsl:if>
  60. </h2>
  61. <table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
  62. <tr>
  63. <td nowrap="1" class="header" _locID="Filename">Filename</td>
  64. <td nowrap="1" class="header" _locID="Status">Status</td>
  65. <td nowrap="1" class="header" _locID="Errors">Errors</td>
  66. <td nowrap="1" class="header" _locID="Warnings">Warnings</td>
  67. </tr>
  68. <xsl:for-each select="source">
  69. <xsl:sort select="@name" order="ascending"/>
  70. <xsl:variable name="source-id" select="generate-id(.)"/>
  71. <xsl:if test="count(event)!=count(event[@error-level='4'])">
  72. <tr class="row">
  73. <td class="content">
  74. <A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
  75. </td>
  76. <td class="content">
  77. <xsl:if test="count(event[@error-level='3'])=1">
  78. <xsl:for-each select="event[@error-level='3']">
  79. <xsl:if test="@description='Converted'"><a _locID="Converted1">Converted</a></xsl:if>
  80. <xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
  81. </xsl:for-each>
  82. </xsl:if>
  83. <xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Converted</a>
  84. </xsl:if>
  85. </td>
  86. <td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
  87. <td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
  88. </tr>
  89. <tr class="collapsed" bgcolor="#ffffff">
  90. <xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
  91. <td colspan="7">
  92. <table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
  93. <tr>
  94. <td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Report - <xsl:value-of select="@name"/>:</td>
  95. </tr>
  96. <xsl:for-each select="event[@error-level!='3']">
  97. <xsl:if test="@error-level!='4'">
  98. <tr>
  99. <td class="issuenone" style="border-bottom:solid 1 lightgray">
  100. <xsl:value-of select="@description"/>
  101. </td>
  102. </tr>
  103. </xsl:if>
  104. </xsl:for-each>
  105. </table>
  106. </td>
  107. </tr>
  108. </xsl:if>
  109. </xsl:for-each>
  110. <tr valign="top">
  111. <td class="foot">
  112. <xsl:if test="count(source)!=1">
  113. <xsl:value-of select="count(source)"/><a _locID="file1"> files</a>
  114. </xsl:if>
  115. <xsl:if test="count(source)=1">
  116. <a _locID="file2">1 file</a>
  117. </xsl:if>
  118. </td>
  119. <td class="foot">
  120. <a _locID="Converted3">Converted</a>:&#32;<xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
  121. <a _locID="NotConverted">Not converted</a>:&#32;<xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
  122. </td>
  123. <td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
  124. <td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
  125. </tr>
  126. </table>
  127. </xsl:for-each>
  128. </xsl:template>
  129. <xsl:template match="Property">
  130. <xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
  131. <tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
  132. </xsl:if>
  133. </xsl:template>
  134. <xsl:template match="UpgradeLog">
  135. <html>
  136. <head>
  137. <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
  138. <link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
  139. <title _locID="ConversionReport0">Conversion Report&#32;
  140. <xsl:if test="Properties/Property[@Name='LogNumber']">
  141. <xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
  142. </xsl:if>
  143. </title>
  144. <script language="javascript">
  145. function outliner () {
  146. oMe = window.event.srcElement
  147. //get child element
  148. var child = document.all[event.srcElement.getAttribute("child",false)];
  149. //if child element exists, expand or collapse it.
  150. if (null != child)
  151. child.className = child.className == "collapsed" ? "expanded" : "collapsed";
  152. }
  153. function changepic() {
  154. uMe = window.event.srcElement;
  155. var check = uMe.src.toLowerCase();
  156. if (check.lastIndexOf("upgradereport_plus.gif") != -1)
  157. {
  158. uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
  159. }
  160. else
  161. {
  162. uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
  163. }
  164. }
  165. </script>
  166. </head>
  167. <body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
  168. <h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
  169. <p><span class="note">
  170. <b _locID="TimeOfConversion">Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
  171. </span></p>
  172. <xsl:variable name="SortedEvents">
  173. <Events>
  174. <xsl:for-each select="Event">
  175. <xsl:sort select="@Project" order="ascending"/>
  176. <xsl:sort select="@Source" order="ascending"/>
  177. <xsl:sort select="@ErrorLevel" order="ascending"/>
  178. <Event>
  179. <xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
  180. <xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
  181. <xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
  182. <xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
  183. <xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
  184. </Event>
  185. </xsl:for-each>
  186. </Events>
  187. </xsl:variable>
  188. <xsl:variable name="Projects">
  189. <xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
  190. </xsl:variable>
  191. <xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
  192. <p></p><p>
  193. <table class="note">
  194. <tr>
  195. <td nowrap="1">
  196. <b _locID="ConversionSettings">Conversion Settings</b>
  197. </td>
  198. </tr>
  199. <xsl:apply-templates select="Properties"/>
  200. </table></p>
  201. </body>
  202. </html>
  203. </xsl:template>
  204. </xsl:stylesheet>