<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:html="http://www.w3.org/TR/REC-html40"
                xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
                xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title>Video Sitemap</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
                <style type="text/css">
                    body {
                        font-family: Helvetica, Arial, sans-serif;
                        font-size: 13px;
                        margin: 0;
                        padding: 45px;
                        color: #545353;
                    }
                    p.expl a {
                        color: #DA3114;
                        font-weight: bold;
                    }
                    a {
                        color: #339;
                        text-decoration: none;
                    }

                    a:visited {
                        color: #777;
                    }

                    a:hover {
                        text-decoration: underline;
                    }

                    #box-table-a {
                        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
                        font-size: 12px;
                        text-align: left;
                        border-collapse: collapse;
                    }

                    #box-table-a th {
                        font-size: 13px;
                        font-weight: normal;
                        padding: 8px;
                        background: #b9c9fe;
                        border-top: 4px solid #aabcfe;
                        border-bottom: 1px solid #fff;
                        color: #039;
                    }

                    #box-table-a td {
                        padding: 8px;
                        background: #e8edff;
                        border-bottom: 1px solid #fff;
                        color: #669;
                        border-top: 1px solid transparent;
                    }

                    #box-table-a tr:hover td {
                        background: #d0dafd;
                        color: #339;
                    }
                </style>
            </head>
            <body>
                <h1>XML Video Sitemap</h1>
                <p class="expl">
                    Generated by <a href="http://www.creativemodules.com/">Creative Modules</a>'s
                    <a href="http://www.creativemodules.com/">Video SEO plugin</a>
                </p>
                <p class="expl">
                    This sitemap contains
                    <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
                </p>

                <table width="100%" id="box-table-a">
                    <thead>
                        <th scope="col" width="10%">Video</th>
                        <th scope="col" width="25%">Post / Page</th>
                        <th scope="col" width="30%">Description</th>
                        <th scope="col" width="20%">Tags</th>
                        <th scope="col" width="15%">Pub Date</th>
                    </thead>
                    <tbody>
                        <xsl:for-each select="sitemap:urlset/sitemap:url">
                            <xsl:variable name="u">
                                <xsl:value-of select="sitemap:loc"/>
                            </xsl:variable>
                            <xsl:variable name="t">
                                <xsl:value-of select="video:video/video:thumbnail_loc"/>
                            </xsl:variable>
                            <tr>
                                <td>
                                    <a href="{$u}">
                                        <img src="{$t}" width="90" height="60"/>
                                    </a>
                                </td>
                                <td>
                                    <a href="{$u}">
                                        <xsl:value-of select="video:video/video:title"/>
                                    </a>
                                </td>
                                <td>
                                    <a href="{$u}">
                                        <xsl:value-of select="video:video/video:description"/>
                                    </a>
                                </td>
                                <td>
                                    <xsl:for-each select="video:video/video:tag"><xsl:value-of select="."/>,
                                    </xsl:for-each>
                                </td>
                                <td>
                                    <xsl:value-of
                                            select="concat(substring(video:video/video:publication_date,0,11),concat(' ', substring(video:video/video:publication_date,12,5)))"/>
                                </td>
                            </tr>
                        </xsl:for-each>
                    </tbody>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
