Skip to content

Instantly share code, notes, and snippets.

@paulodiogo
Created June 4, 2021 02:49
Show Gist options
  • Save paulodiogo/34064e8910089fe1f140ff9f565c20ec to your computer and use it in GitHub Desktop.
Save paulodiogo/34064e8910089fe1f140ff9f565c20ec to your computer and use it in GitHub Desktop.
Migrating from MvcSiteMapProvider to cloudscribe.Web.Navigation
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@title">
<xsl:attribute name="text">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="mvcSiteMapNode">
<NavNode>
<xsl:apply-templates select="@*" />
<xsl:attribute name="key"><xsl:value-of select="@controller"/>.<xsl:value-of select="@action"/></xsl:attribute>
<xsl:if test="mvcSiteMapNode">
<Children>
<xsl:apply-templates select="node()"/>
</Children>
</xsl:if>
</NavNode>
</xsl:template>
</xsl:transform>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment