Created
May 4, 2009 17:16
-
-
Save carsten/106555 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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" indent="yes" omit-xml-declaration="no" /> | |
<xsl:template match="/"> | |
<xsl:call-template name="sitemap" /> | |
</xsl:template> | |
<xsl:template name="sitemap"> | |
<urlset> | |
<xsl:attribute name="xmlns">http://www.sitemaps.org/schemas/sitemap/0.9</xsl:attribute> | |
<xsl:apply-templates select="/data/navigation/page[not(types/type = 'hidden') and not(types/type = 'admin')]" mode="sitemap" /> | |
</urlset> | |
</xsl:template> | |
<xsl:template match="page" mode="sitemap"> | |
<xsl:param name="root" select="$root" /> | |
<url> | |
<loc><xsl:value-of select="concat($root, '/', @handle, '/')" /></loc> | |
</url> | |
<xsl:apply-templates select="page[not(types/type = 'hidden') and not(types/type = 'admin')]" mode="sitemap"> | |
<xsl:with-param name="root" select="concat($root, '/', @handle)" /> | |
</xsl:apply-templates> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment