ConversionLogFile.xsl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
  3. <xsl:output method="html"/>
  4. <!-- used for output formatting: -->
  5. <xsl:variable name="NewLine"><br /></xsl:variable>
  6. <xsl:variable name="Blank">
  7. <xsl:text> </xsl:text>
  8. </xsl:variable>
  9. <xsl:variable name="ProjectName" select="/LogFile/@projectName"/>
  10. <xsl:variable name="TypeColHeader" select="/LogFile/@typeText"/>
  11. <xsl:variable name="MessageColHeader" select="/LogFile/@messageText"/>
  12. <xsl:variable name="TimeColHeader" select="/LogFile/@timeText"/>
  13. <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
  14. <!-- start on document root: -->
  15. <xsl:template match="/LogFile">
  16. <html>
  17. <xsl:value-of select="$NewLine"/>
  18. <head>
  19. <title>Conversion log file</title>
  20. <style type="text/css">
  21. .TitleText { font-family:'Siemens TIA Portal Basic'; font-size:15pt; font-weight: bold; color: #59717d; line-height:23px; }
  22. .Text { font-family:'Siemens TIA Portal Basic'; font-size:10pt; font-weight: bold; color: black; line-height:26px; }
  23. .TableHeader { font-family:'Siemens TIA Portal Basic'; font-size:10pt; font-weight: bold; height: 15pt; text-indent: 6px; border-style: solid; border-color: #8ca3b0; border-width: 0.5pt 0.5pt 0.5pt 0; font-weight: bold; background-color:#b6c5cf; }
  24. .TableHeader1 { font-family:'Siemens TIA Portal Basic'; font-size:10pt; font-weight: bold; height: 15pt; text-indent: 6px; border-style: solid; border-color: #bfbfbf; border-width: 0 0.5pt 0.5pt 0; font-weight: bold; background-color:#d4dbde; }
  25. .TableHeader2 { font-family:'Siemens TIA Portal Basic'; font-size:10pt; font-weight: bold; height: 15pt; text-indent: 6px; border-style: solid; border-color: #bfbfbf; border-width: 0 0.5pt 0.5pt 0; font-weight: bold; background-color:#e7ebed; }
  26. .TableContent { font-family:'Siemens TIA Portal Basic'; font-size:10pt; height: 15pt; text-indent: 6px; border-style: solid; border-color: #bfbfbf; border-width: 0 0.5pt 0.5pt 0; }
  27. .TableGraphicActionRequest { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoActionRequest.png', sizingMethod='center'); background:none; align:center; width:16px }
  28. .TableGraphicDecision { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoDecision.png', sizingMethod='center'); background:none; align:center; width:16px }
  29. .TableGraphicDecisionCritical { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoDecisionCritical.png', sizingMethod='center'); background:none; align:center; width:16px }
  30. .TableGraphicError { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoError.png', sizingMethod='center'); background:none; align:center; width:16px }
  31. .TableGraphicErrorCritical { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoErrorCritical.png', sizingMethod='center'); background:none; align:center; width:16px }
  32. .TableGraphicInformation { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoInformation.png', sizingMethod='center'); background:none; align:center; width:16px }
  33. .TableGraphicInputRequired { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoInputRequired.png', sizingMethod='center'); background:none; align:center; width:16px }
  34. .TableGraphicSuccess { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoSuccess.png', sizingMethod='center'); background:none; align:center; width:16px }
  35. .TableGraphicWarning { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ICO_PE_InfoWarning.png', sizingMethod='center'); background:none; align:center; width:16px }
  36. .TimeStampCell { font-family:'Siemens TIA Portal Basic'; font-size:9pt; font-weight: normal; height: 18px; text-indent: 6px;}
  37. </style>
  38. </head>
  39. <body>
  40. <p class="TitleText">
  41. <xsl:value-of select="$ProjectName"/>
  42. </p>
  43. <xsl:value-of select="$NewLine"/>
  44. <table cellspacing="0" cellpadding="3" style="border-left: 1px solid #bfbfbf">
  45. <tr class="TableHeader">
  46. <td class="TableHeader" align="left" style="width: 32px; ">
  47. <xsl:value-of select="$TypeColHeader"/>
  48. </td>
  49. <td class="TableHeader" align="left" style="width: 648px; ">
  50. <xsl:value-of select="$MessageColHeader"/>
  51. </td>
  52. <td class="TableHeader" align="left" style="width: 90px">
  53. <xsl:value-of select="$TimeColHeader"/>
  54. </td>
  55. </tr>
  56. <xsl:apply-templates select="MessageCell"/>
  57. </table>
  58. </body>
  59. </html>
  60. </xsl:template>
  61. <xsl:template name="LogEntry" match="*/MessageCell">
  62. <tr class="TableContent">
  63. <td align="center" class="TableContent">
  64. <p>
  65. <img class="TableGraphic">
  66. <xsl:attribute name="alt">
  67. <xsl:value-of select="@MessageClass"/>
  68. </xsl:attribute>
  69. <xsl:attribute name="src">
  70. <xsl:choose>
  71. <xsl:when test="@MessageClass = 'Error'">ICO_PE_InfoError.png</xsl:when>
  72. <xsl:when test="@MessageClass = 'ErrorCritical'">ICO_PE_InfoErrorCritical.png</xsl:when>
  73. <xsl:when test="@MessageClass = 'Information'">ICO_PE_InfoInformation.png</xsl:when>
  74. <xsl:when test="@MessageClass = 'Success'">ICO_PE_InfoSuccess.png</xsl:when>
  75. <xsl:when test="@MessageClass = 'Warning'">ICO_PE_InfoWarning.png</xsl:when>
  76. <xsl:otherwise>TableContent</xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:attribute>
  79. </img>
  80. </p>
  81. </td>
  82. <td align="left" class="TableContent">
  83. <xsl:call-template name="FilterText">
  84. <xsl:with-param name="Text" select="Text/@FeedbackText"/>
  85. </xsl:call-template>
  86. <img width="1px" src="ICO_PE_Empty.png"/>
  87. </td>
  88. <td align="left" class="TableContent">
  89. <xsl:value-of select="@Timestamp"/>
  90. <img width="1px" src="ICO_PE_Empty.png"/>
  91. </td>
  92. </tr>
  93. </xsl:template>
  94. <xsl:template name="FilterText">
  95. <xsl:param name="Text"/>
  96. <xsl:choose>
  97. <xsl:when test="contains($Text, '&lt;!--')">
  98. <xsl:call-template name="FilterText">
  99. <xsl:with-param name="Text" select="concat(substring-before($Text, '&lt;!--'), substring-after($Text, '--&gt;'))"/>
  100. </xsl:call-template>
  101. </xsl:when>
  102. <xsl:otherwise>
  103. <xsl:value-of select="$Text"/>
  104. </xsl:otherwise>
  105. </xsl:choose>
  106. </xsl:template>
  107. </xsl:stylesheet>