<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A CMS and .NET Development Blog by Tomas Breen &#187; XSLT</title>
	<atom:link href="http://www.tomasbreen.com/wp/index.php/category/xslt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tomasbreen.com/wp</link>
	<description>Blogging about SharePoint, CRM, .NET &#38; AJAX</description>
	<lastBuildDate>Tue, 08 Feb 2011 13:34:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Recursive Navigation in Umbraco</title>
		<link>http://www.tomasbreen.com/wp/index.php/2010/01/recursive-navigation-in-umbraco/</link>
		<comments>http://www.tomasbreen.com/wp/index.php/2010/01/recursive-navigation-in-umbraco/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 14:40:06 +0000</pubDate>
		<dc:creator>Tomas Breen</dc:creator>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://www.tomasbreen.com/wp/?p=41</guid>
		<description><![CDATA[A recursive call in XSLT can be a bit confusing. It was for me. Here is a simple stylesheet that gets all nodes in this section (Usually a section in Umbraco sits underneath the Hompage, e.g. Content -&#62; Homepage -&#62; Section 1).
[codesyntax lang="xml"]
&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;!DOCTYPE xsl:stylesheet [
  &#60;!ENTITY nbsp "&#38;#x00A0;"&#62;
]&#62;
&#60;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"&#62;

  &#60;xsl:output method="xml" [...]]]></description>
			<content:encoded><![CDATA[<p>A recursive call in XSLT can be a bit confusing. It was for me. Here is a simple stylesheet that gets all nodes in this section (Usually a section in Umbraco sits underneath the Hompage, e.g. Content -&gt; Homepage -&gt; Section 1).</p>
<p>[codesyntax lang="xml"]</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE xsl:stylesheet [
  &lt;!ENTITY nbsp "&amp;#x00A0;"&gt;
]&gt;
&lt;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"&gt;

  &lt;xsl:output method="xml" omit-xml-declaration="yes" /&gt;

  &lt;xsl:param name="currentPage"/&gt;

  &lt;xsl:param name="level" select="2"/&gt;

  &lt;xsl:template match="/"&gt;
    &lt;xsl:call-template name="menu"&gt;
      &lt;xsl:with-param name="level" select="$level"/&gt;
    &lt;/xsl:call-template&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template name="menu"&gt;
    &lt;xsl:param name="level"/&gt;

    &lt;ul class="level_{@level}"&gt;
      &lt;xsl:if test="count($currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']) &amp;gt; '0'"&gt;
        &lt;xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']"&gt;
          &lt;li&gt;
              &lt;a href="{umbraco.library:NiceUrl(@id)}"&gt;
                &lt;xsl:if test="$currentPage/@id = current()/@id"&gt;
                  &lt;xsl:attribute name="class"&gt;Selected&lt;/xsl:attribute&gt;
                &lt;/xsl:if&gt;
                &lt;xsl:value-of select="@nodeName"/&gt;
              &lt;/a&gt;
            &lt;xsl:if test="count(current()/node [string(data [@alias='umbracoNaviHide']) != '1']) &amp;gt; '0'"&gt;
              &lt;xsl:call-template name="submenu"&gt;
                &lt;xsl:with-param name="level" select="$level+1"/&gt;
              &lt;/xsl:call-template&gt;
            &lt;/xsl:if&gt;
          &lt;/li&gt;
        &lt;/xsl:for-each&gt;
      &lt;/xsl:if&gt;
    &lt;/ul&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template name="submenu"&gt;
    &lt;xsl:param name="level"/&gt;

    &lt;ul class="level_{@level}"&gt;
      &lt;xsl:for-each select="current()/node [string(data [@alias='umbracoNaviHide']) != '1']"&gt;
        &lt;li&gt;
            &lt;a href="{umbraco.library:NiceUrl(@id)}"&gt;
              &lt;xsl:if test="$currentPage/@id = current()/@id"&gt;
                &lt;xsl:attribute name="class"&gt;Selected&lt;/xsl:attribute&gt;
              &lt;/xsl:if&gt;
              &lt;xsl:value-of select="@nodeName"/&gt;
            &lt;/a&gt;
          &lt;xsl:if test="count(current()/node [string(data [@alias='umbracoNaviHide']) != '1']) &amp;gt; '0'"&gt;
            &lt;xsl:call-template name="submenu"&gt;
              &lt;xsl:with-param name="level" select="$level+1"/&gt;
            &lt;/xsl:call-template&gt;
          &lt;/xsl:if&gt;
        &lt;/li&gt;
      &lt;/xsl:for-each&gt;
    &lt;/ul&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre>
<p>[/codesyntax]</p>
<p>This code also adds a class to the node you are currently visiting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomasbreen.com/wp/index.php/2010/01/recursive-navigation-in-umbraco/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

