Did you create this XSLT from the umbraco backend?
If not, go to the Developer-section and right-click on "XSLT" and choose "Create", you can select "Sitemap" and umbraco will generate a fully functional sitemap for your site (including the new XSLT-schema).
edit: Did you render the macro somewhere in your template?
Thanks for the reply Patrik. I did render the macro in my template. I didn't look at the tool to generate the sitemap under developer section. Thanks for pointing that out.
I have worked out the following XSLT that works fine.
Umbraco 4.5 Sitemap
Hello,
I am very new to umbraco and having issues generating the sitemap.
Here is the site structure
Home
Subpage1
subsubpage1
Subpage2
subsubpage2
.....
....
Here is the XSLT i am using
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="html"/>
<xsl:param name="currentPage"/>
<xsl:variable name="maxLevelForSitemap" select="6"/>
<xsl:template match="/">
<div id="sitemap">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::*[@level = 1]/* [string(umbracoNaviHide) != '1']"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<ul>
hello
<xsl:value-of select="$parent"/>
<xsl:for-each select="$parent/node">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
The above xslt doesn't generate the sitemap.
Please advice.
Did you create this XSLT from the umbraco backend?
If not, go to the Developer-section and right-click on "XSLT" and choose "Create", you can select "Sitemap" and umbraco will generate a fully functional sitemap for your site (including the new XSLT-schema).
edit: Did you render the macro somewhere in your template?
Thanks for the reply Patrik. I did render the macro in my template. I didn't look at the tool to generate the sitemap under developer section. Thanks for pointing that out.
I have worked out the following XSLT that works fine.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="html"/>
<xsl:param name="currentPage"/>
<xsl:variable name="maxLevelForSitemap" select="6"/>
<xsl:template match="/">
<div id="sitemap">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@level = 1]"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<ul>
<xsl:for-each select="$parent/* [string(umbracoNaviHide) != '1' and @isDoc]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Thanks again for the quick reply.
Thank you, thank you, thank you! That worked a treat (the code from 611 didn't work).
Sai.
is working on a reply...