Skip to content

Instantly share code, notes, and snippets.

@uniquelau
Last active January 4, 2016 05:49
Show Gist options
  • Save uniquelau/8577765 to your computer and use it in GitHub Desktop.
Save uniquelau/8577765 to your computer and use it in GitHub Desktop.
<xsl:template match="* [@isDoc]" mode="sitemap-entry">
<xsl:param name="metaSitemapChangeFreq" select="&DefaultChangeFreq;" />
<xsl:param name="metaSitemapPriority" select="&DefaultPriority;"/>
<xsl:param name="recurse" select="true()" />
<url>
<loc>
<xsl:apply-templates select="@id" />
</loc>
<lastmod><xsl:value-of select="@updateDate" />+00:00</lastmod>
<changefreq>
<xsl:value-of select="$metaSitemapChangeFreq" />
</changefreq>
<priority>
<xsl:value-of select="$metaSitemapPriority" />
</priority>
<!-- THE UGLY -->
<xsl:if test="metaSitemapChangeFreq">
<changefreq><xsl:value-of select="metaSitemapChangeFreq" /></changefreq>
</xsl:if>
<xsl:if test="metaSitemapPriority">
<priority><xsl:value-of select="metaSitemapPriority" /></priority>
</xsl:if>
</url>
<!-- If recurse then, play it again! --->
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment