page2.xsl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:template match="/">
  4. <html>
  5. <head>
  6. <title>日志查询列表</title>
  7. <style>
  8. body,BlueIdea,team,blue_ID,blue_name,blue_text,blue_time,blue_class{ font: 12px "宋体", "Arial", "Times New Roman"; }
  9. table { font-size: 12px; border: 0px double; border-color: #99CC99 #99CC99 #CCCCCC #CCCCCC; cellpadding:3;cellspacing:3; bgcolor:#eeeeee; text-decoration: blink}
  10. span { font-size: 12px; color: red; }
  11. .keybutton { cursor:hand; font-size: 12px; color: #003300; background: #ffffff; border: 0px solid;}
  12. </style>
  13. <script>
  14. <xsl:comment>
  15. <![CDATA[
  16. var OnePageNum=50;
  17. var PageNum=1;
  18. var XMLPageNum=1;
  19. function pages(Num)
  20. {
  21. stylesheet=document.XSLDocument;
  22. source=document.XMLDocument;
  23. nodes=source.documentElement.childNodes;
  24. len=nodes.length;
  25. for(i=1;i<=(len/OnePageNum);i++);
  26. XMLPageNum=i;
  27. var firstNum=0;
  28. var lastNume=0;
  29. if (Num=="first") {PageNum=1;}
  30. if (Num=="previous") {if (PageNum>1) PageNum -=1;}
  31. if (Num=="next") {if (PageNum<XMLPageNum) PageNum +=1;}
  32. if (Num=="last") {PageNum =XMLPageNum;}
  33. sortField=document.XSLDocument.selectSingleNode("//@expr");
  34. firstNum=OnePageNum*(PageNum-1)+1;
  35. lastNum=OnePageNum*(PageNum-1)+OnePageNum;
  36. text="childnumber(this)>="+firstNum+" & childnumber(this)<="+lastNum;
  37. sortField.value=text;
  38. Layer1.innerHTML=source.documentElement.transformNode(stylesheet);
  39. }
  40. ]]>
  41. </xsl:comment>
  42. </script>
  43. </head>
  44. <body>
  45. <table align="center" width="740" >
  46. <tr>
  47. <td>
  48. <button id="cmdfirstPage" class="keybutton" onclick="pages('first');" >首页</button>
  49. <button id="cmdpreviousPage" class="keybutton" onclick="pages('previous');" >上一页</button>
  50. <button id="cmdnextPage" class="keybutton" onclick="pages('next');">下一页</button>
  51. <button id="cmdlastPage" class="keybutton" onclick="pages('last');">尾页</button>
  52. </td>
  53. </tr>
  54. </table>
  55. <div id="Layer1" name="Layer1"> <xsl:apply-templates select="data" /></div>
  56. </body>
  57. </html>
  58. </xsl:template>
  59. <xsl:template match="data">
  60. <table width="740" border="0" align="center" cellpadding="1" cellspacing="1" bordercolordark="#ffffff" bordercolorlight="#ADAAAD">
  61. <tr bgcolor="#FFCC99" align="center">
  62. <td height="20"><strong>变量名称</strong></td>
  63. <td><strong>值</strong></td>
  64. <td><strong>发生时间</strong></td>
  65. <td><strong>报警内容</strong></td>
  66. </tr>
  67. <xsl:apply-templates select="subdata" order-by="varname"/>
  68. </table>
  69. </xsl:template>
  70. <xsl:template match="subdata">
  71. <xsl:if expr="childnumber(this)&gt;=1 &amp; childnumber(this)&lt;=50 ">
  72. <tr align="center">
  73. <xsl:apply-templates select="varname" />
  74. <xsl:apply-templates select="value" />
  75. <xsl:apply-templates select="happentime" />
  76. <xsl:apply-templates select="warncontent" />
  77. </tr>
  78. </xsl:if>
  79. </xsl:template>
  80. <xsl:template match="varname">
  81. <td bgcolor="#eeeeee" height="16">
  82. <xsl:value-of />
  83. </td>
  84. </xsl:template>
  85. <xsl:template match="value">
  86. <td bgcolor="#f3f3f3">
  87. <xsl:value-of />
  88. </td>
  89. </xsl:template>
  90. <xsl:template match="happentime">
  91. <td bgcolor="#efefef">
  92. <xsl:value-of />
  93. </td>
  94. </xsl:template>
  95. <xsl:template match="warncontent">
  96. <td bgcolor="#f3f3f3" align="left" style="padding-left:20px;">
  97. <xsl:value-of />
  98. </td>
  99. </xsl:template>
  100. </xsl:stylesheet>