Created
May 14, 2020 02:11
-
-
Save tomhodgins/1c483aea241a9ff460a4e7cd3fcdd718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" | |
> | |
<xsl:output | |
method="xml" | |
encoding="utf-8" | |
indent="yes" | |
media-type="text/html" | |
omit-xml-declaration="yes" | |
doctype-system="about:legacy-compat" | |
/> | |
<xsl:template match="/"> | |
<html> | |
<meta charset="utf-8" /> | |
<h1>Sitemap</h1> | |
<xsl:apply-templates /> | |
</html> | |
</xsl:template> | |
<xsl:template match="//node()[local-name() = name()]"> | |
<xsl:apply-templates /> | |
</xsl:template> | |
<xsl:template match="//sitemap:urlset"> | |
<ul> | |
<xsl:for-each select="sitemap:url"> | |
<li><a href="{sitemap:loc}" title="Last updated {sitemap:lastmod}"><xsl:value-of select="sitemap:loc" /></a></li> | |
</xsl:for-each> | |
</ul> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml-stylesheet type="text/xsl" href="sitemap-stylesheet.xsl"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc>https://example.com/page1</loc> | |
<lastmod>2020-05-08T09:35:39+01:00</lastmod> | |
</url> | |
<url> | |
<loc>https://example.com/page2</loc> | |
<lastmod>2020-05-08T09:35:39+01:00</lastmod> | |
</url> | |
<url> | |
<loc>https://example.com/page3</loc> | |
<lastmod>2020-05-13T13:49:48+01:00</lastmod> | |
</url> | |
</urlset> |
Author
tomhodgins
commented
May 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment