Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2010
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.71 KB | None | 0 0
  1.   <?xml version="1.0" ?>
  2. - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. - <!--  localized strings
  4.  -->
  5.   <xsl:variable name="ColumnHeader_Date">Date</xsl:variable>
  6.   <xsl:variable name="ColumnHeader_Time">Time</xsl:variable>
  7.   <xsl:variable name="ColumnHeader_From">From</xsl:variable>
  8.   <xsl:variable name="ColumnHeader_To">To</xsl:variable>
  9.   <xsl:variable name="ColumnHeader_Message">Message</xsl:variable>
  10. - <!--  variables
  11.  -->
  12.   <xsl:variable name="Debug">0</xsl:variable>
  13.   <xsl:variable name="TableStyle">font-family:Segoe UI; font-size:75%; text-align:left; vertical-align:top; table-layout:fixed</xsl:variable>
  14.   <xsl:variable name="GutterStyle">width:2ex</xsl:variable>
  15.   <xsl:variable name="HeaderStyle">border-bottom:1 solid black</xsl:variable>
  16.   <xsl:variable name="UseZebraStripe">1</xsl:variable>
  17.   <xsl:variable name="ZebraStripeStyle">background-color:#e0edff</xsl:variable>
  18.   <xsl:variable name="MostRecentSessionFirst">0</xsl:variable>
  19. - <xsl:template match="Log">
  20. - <html dir="ltr">
  21. - <head>
  22. - <title>
  23.   Message Log for
  24.   <xsl:value-of select="@LogonName" />
  25.   <xsl:if test="$Debug = 1">(Debug)</xsl:if>
  26.   </title>
  27. - <xsl:if test="$Debug = 1">
  28.   <span style="font-family:trebuchet ms; font-size:120%">Debug Version</span>
  29.   <hr />
  30.   </xsl:if>
  31.   </head>
  32. - <body style="margin:0">
  33. - <table id="BodyTable" style="{$TableStyle}" cellspacing="0">
  34. - <xsl:if test="$Debug = 1">
  35.   <col style="vertical-align:top; width:5ex;" />
  36.   <col style="{$GutterStyle}" />
  37.   </xsl:if>
  38.   <col style="width:16ex;" />
  39.   <col style="{$GutterStyle}" />
  40.   <col style="width:16ex;" />
  41.   <col style="{$GutterStyle}" />
  42.   <col style="width:21ex;" />
  43.   <col style="{$GutterStyle}" />
  44.   <col style="width:21ex;" />
  45.   <col style="{$GutterStyle}" />
  46.   <col style="width:70ex;" />
  47. - <thead>
  48. - <tr>
  49. - <xsl:if test="$Debug = 1">
  50.   <th style="{$HeaderStyle}">SID</th>
  51.   <th />
  52.   </xsl:if>
  53. - <th style="{$HeaderStyle}">
  54.   <xsl:value-of select="$ColumnHeader_Date" />
  55.   </th>
  56.   <th />
  57. - <th style="{$HeaderStyle}">
  58.   <xsl:value-of select="$ColumnHeader_Time" />
  59.   </th>
  60.   <th />
  61. - <th style="{$HeaderStyle}">
  62.   <xsl:value-of select="$ColumnHeader_From" />
  63.   </th>
  64.   <th />
  65. - <th style="{$HeaderStyle}">
  66.   <xsl:value-of select="$ColumnHeader_To" />
  67.   </th>
  68.   <th />
  69. - <th style="{$HeaderStyle}">
  70.   <xsl:value-of select="$ColumnHeader_Message" />
  71.   </th>
  72.   </tr>
  73.   </thead>
  74. - <tbody style="vertical-align:top">
  75. - <xsl:choose>
  76. - <!--  newest session first
  77.  -->
  78. - <xsl:when test="$MostRecentSessionFirst = 1">
  79. - <xsl:apply-templates>
  80.   <xsl:sort select="@SessionID" order="descending" data-type="number" />
  81.   <xsl:sort select="@DateTime" order="ascending" />
  82.   </xsl:apply-templates>
  83.   </xsl:when>
  84. - <!--  oldest session first
  85.  -->
  86. - <xsl:otherwise>
  87. - <xsl:apply-templates>
  88.   <xsl:sort select="@SessionID" order="ascending" data-type="number" />
  89.   <xsl:sort select="@DateTime" order="ascending" />
  90.   </xsl:apply-templates>
  91.   </xsl:otherwise>
  92.   </xsl:choose>
  93.   </tbody>
  94.   </table>
  95.   </body>
  96.   </html>
  97.   </xsl:template>
  98. - <xsl:template match="Message">
  99. - <tr>
  100.   <xsl:call-template name="CommonMessageProcessing" />
  101. - <td>
  102.   <xsl:apply-templates select="From/User" />
  103.   </td>
  104.   <td />
  105. - <td>
  106.   <xsl:apply-templates select="To/User" />
  107.   </td>
  108.   <td />
  109. - <td>
  110. - <span>
  111. - <xsl:attribute name="style">
  112.   <xsl:value-of select="Text/@Style" />
  113.   </xsl:attribute>
  114.   <xsl:value-of select="Text" />
  115.   </span>
  116.   </td>
  117.   </tr>
  118.   </xsl:template>
  119. - <xsl:template match="Invitation|InvitationResponse|Join|Leave">
  120. - <tr>
  121.   <xsl:call-template name="CommonMessageProcessing" />
  122.   <td />
  123. - <!--  From
  124.  -->
  125.   <td />
  126.   <td />
  127. - <!--  To
  128.  -->
  129.   <td />
  130. - <td>
  131. - <span>
  132. - <xsl:attribute name="style">
  133.   <xsl:value-of select="Text/@Style" />
  134.   </xsl:attribute>
  135.   <xsl:value-of select="Text" />
  136.   </span>
  137.   </td>
  138.   </tr>
  139.   </xsl:template>
  140. - <xsl:template match="User">
  141. - <!--  add a comma before all but the first user
  142.  -->
  143.   <xsl:if test="position() != 1">,</xsl:if>
  144.   <xsl:value-of select="@FriendlyName" />
  145.   </xsl:template>
  146. - <xsl:template name="CommonMessageProcessing">
  147. - <!--  zebra-stripe the sessions
  148.  -->
  149. - <xsl:if test="$UseZebraStripe = 1">
  150. - <xsl:if test="(@SessionID mod 2) = 1">
  151. - <xsl:attribute name="style">
  152.   <xsl:value-of select="$ZebraStripeStyle" />
  153.   </xsl:attribute>
  154.   </xsl:if>
  155.   </xsl:if>
  156. - <xsl:if test="$Debug = 1">
  157. - <td>
  158.   <xsl:value-of select="@SessionID" />
  159.   </td>
  160.   <td />
  161.   </xsl:if>
  162. - <td>
  163.   <xsl:value-of select="@Date" />
  164.   </td>
  165.   <td />
  166. - <td>
  167.   <xsl:value-of select="@Time" />
  168.   </td>
  169.   <td />
  170.   </xsl:template>
  171.   </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement