xml.xsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" exclude-result-prefixes="s">
  3. <xsl:template match="/">
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8"/>
  7. <title>XML Sitemap</title>
  8. <script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery/jquery-1.4.2.min.js"></script>
  9. <script type="text/javascript" src="https://cdn.damianoff.com/repo/jquery.tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
  10. <script type="text/javascript"><![CDATA[
  11. $(document).ready(function() {
  12. $("#sitemap").tablesorter({sortList:[[6,1],[4,1]],widgets:['zebra']});
  13. $('.url').click(function(){
  14. window.open($(this).html());
  15. return false;
  16. });
  17. });]]></script>
  18. <style type="text/css">
  19. body
  20. {
  21. font-family: Helvetica, Arial, sans-serif;
  22. font-size: 13px;
  23. color: #545353;
  24. }
  25. table
  26. {
  27. border: none;
  28. border-collapse: collapse;
  29. }
  30. #sitemap tr.odd
  31. {
  32. background-color: #eee;
  33. }
  34. #sitemap tbody tr:hover
  35. {
  36. background-color: #ccc;
  37. }
  38. #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a
  39. {
  40. color: #000;
  41. }
  42. #content
  43. {
  44. margin: 10px auto;
  45. max-width: 960px;
  46. }
  47. .expl
  48. {
  49. margin: 10px 3px;
  50. line-height: 1.3em;
  51. }
  52. .expl a, .expl a:visited, footer a, footer a:visited
  53. {
  54. color: #da3114;
  55. font-weight: bold;
  56. }
  57. a
  58. {
  59. color: #000;
  60. text-decoration: none;
  61. }
  62. a:visited
  63. {
  64. color: #777;
  65. }
  66. a:hover
  67. {
  68. text-decoration: underline;
  69. }
  70. td
  71. {
  72. font-size:11px;
  73. }
  74. th
  75. {
  76. text-align:left;
  77. padding: 5px 20px 5px 5px;
  78. font-size: 12px;
  79. }
  80. thead th
  81. {
  82. border-bottom: 1px solid #dedede;
  83. cursor: pointer;
  84. }
  85. footer
  86. {
  87. margin:20px auto;
  88. text-align:left;
  89. max-width:100%;
  90. }
  91. .url:hover
  92. {
  93. cursor:pointer;
  94. }
  95. </style>
  96. </head>
  97. <body>
  98. <div id="content">
  99. <h2>XML Sitemap</h2>
  100. <p class="expl">Generated by <a href="https://gitlab.com/Laravelium/Sitemap" target="_blank" title="Sitemap generator for Laravel">laravelium-sitemap</a>. This is styled xml sitemap, sorted by update date.</p>
  101. <p class="expl">This sitemap contains <xsl:value-of select="count(s:urlset/s:url)"/> URLs.</p>
  102. <table id="sitemap" class="tablesorter" border="1" cellpadding="3">
  103. <thead>
  104. <tr bgcolor="#9acd32">
  105. <th style="text-align:left">URL</th>
  106. <th style="text-align:left">Alternates</th>
  107. <th style="text-align:left">Images</th>
  108. <th style="text-align:left">Videos</th>
  109. <th style="text-align:left">Priority</th>
  110. <th style="text-align:left">Update freq</th>
  111. <th style="text-align:left">Updated at</th>
  112. </tr>
  113. </thead>
  114. <tbody>
  115. <xsl:for-each select="s:urlset/s:url">
  116. <tr>
  117. <td class="url"><xsl:value-of select="s:loc"/></td>
  118. <td><xsl:value-of select="count(xhtml:link)"/></td>
  119. <td><xsl:value-of select="count(image:image)"/></td>
  120. <td><xsl:value-of select="count(video:video)"/></td>
  121. <td><xsl:value-of select="concat(s:priority*100,'%')"/></td>
  122. <td><xsl:value-of select="s:changefreq"/></td>
  123. <td><xsl:value-of select="concat(substring(s:lastmod,0,11),concat(' ', substring(s:lastmod,12,5)))"/></td>
  124. </tr>
  125. </xsl:for-each>
  126. </tbody>
  127. </table>
  128. <footer></footer>
  129. </div>
  130. </body>
  131. </html>
  132. </xsl:template>
  133. </xsl:stylesheet>