<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xna="https://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:image="https://www.google.com/schemas/sitemap-image/1.1"
    exclude-result-prefixes="xna">
    <xsl:output indent="yes" method="html" omit-xml-declaration="yes"/>
    <xsl:template match="/">
        <html lang="en-gb">
        <head>
            <title>XML Sitemap File</title>
            <link rel="stylesheet" type="text/css" href="/media/jui/css/icomoon.css"/>
            <style type="text/css">
                <![CDATA[
                body {
                    font-family: tahoma, sans-serif;
                    position: relative;
                }

                table {
                    font-size: 11px;
                    width: 100%;
                }

                th {
                    background: #9f8Fbf;
                    color: #fff;
                    text-align: left;
                    padding: 4px;
                }

                tr:nth-child(even) {
                    background: #eeF8ff;
                }

                td {
                    padding: 1px;
                }

                .data a {
                    text-decoration: none;
                }

                .icon-new-tab {
                    font-size: 10px;
                    margin-left: 4px;
                    color: #b5b5b5;
                }

                .count {
                    font-size: 12px;
                    margin-bottom: 10px;
                }
                ]]>
            </style>
        </head>
        <body>
        <div class="header">
            <div class="title">
                                <div class="count">
                    Total of URLs:
                    <xsl:value-of select="count(xna:urlset/xna:url)"/>
                </div>
            </div>
        </div>

        <table class="data">
            <thead>
            <tr>
                <th>URL</th>
                <th>Last Modification Date</th>
                <th>Change Frequency</th>
                <th>Priority</th>
            </tr>
            </thead>
            <tbody>
            <xsl:for-each select="xna:urlset/xna:url">
                <xsl:variable name="sitemapURL">
                    <xsl:value-of select="xna:loc"/>
                </xsl:variable>
                <tr>
                    <td>
                        <a href="{$sitemapURL}"
                           target="_blank">
                            <xsl:value-of select="$sitemapURL"/>
                        </a>
                        <span class="icon-new-tab"></span>
                    </td>
                    <td>
                        <xsl:value-of select="xna:lastmod"/>
                    </td>
                    <td>
                        <xsl:value-of select="xna:changefreq"/>
                    </td>
                    <td>
                        <xsl:value-of select="xna:priority"/>
                    </td>
                </tr>
            </xsl:for-each>
            </tbody>
        </table>
        </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
