Guest User

Untitled

a guest
Apr 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <h2>audi</h2>
  6. <table>
  7. <thead>
  8. <tr>
  9. <th>Total of samples per second</th>
  10. <th>Time</th>
  11. <th>Total of TRUE</th>
  12. <th>Total of FALSE</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. <tr>
  17. <td>3</td>
  18. <td>1950</td>
  19. <td>2</td>
  20. <td>1</td>
  21. </tr>
  22. <tr>
  23. <td>2</td>
  24. <td>2300</td>
  25. <td>1</td>
  26. <td>1</td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. <h2>renault</h2>
  31. <table>
  32. <thead>
  33. <tr>
  34. <th>Total of samples per second</th>
  35. <th>Time</th>
  36. <th>Total of TRUE</th>
  37. <th>Total of FALSE</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <tr>
  42. <td>2</td>
  43. <td>1500</td>
  44. <td>2</td>
  45. <td>0</td>
  46. </tr>
  47. <tr>
  48. <td>2</td>
  49. <td>2800</td>
  50. <td>1</td>
  51. <td>1</td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. </body>
  56. </html>
  57.  
  58. <xsl:template match="trade">
  59. <xsl:for-each-group select="car" group-by="@brand">
  60. <h2>{current-grouping-key()}</h2>
  61. <table>
  62. <thead>
  63. <tr>
  64. <th>Total of samples</th>
  65. <th>Time</th>
  66. <th>Total of TRUE</th>
  67. <th>Total of FALSE</th>
  68. </tr>
  69. </thead>
  70. <xsl:variable name="sorted-cars" as="element(car)*">
  71. <xsl:perform-sort select="current-group()">
  72. <xsl:sort select="xs:integer(@time)"/>
  73. </xsl:perform-sort>
  74. </xsl:variable>
  75. <tbody>
  76. <xsl:for-each-group select="$sorted-cars" group-adjacent="@time idiv 1000">
  77. <tr>
  78. <td>{count(current-group())}</td>
  79. <td>{current-group()[last()]/@time}</td>
  80. <td>{count(current-group()[@trend = 'true'])}</td>
  81. <td>{count(current-group()[@trend = 'false'])}</td>
  82. </tr>
  83. </xsl:for-each-group>
  84. </tbody>
  85. </table>
  86. </xsl:for-each-group>
  87. </xsl:template>
Add Comment
Please, Sign In to add comment