title: creating a relative path with XSL - baselink:SitemapBaseLink --- cocoon, xslt
body: <p>The problem is that I have a common "XHTML template" but different relative locations and then some of the pages don't the css file. </p>
  
  <p>I tried to do this on sitemap (cocoon)</p>
  
  <pre><code>&lt;map:match pattern="index.html"&gt;
      &lt;map:generate src="data/courses-small.xml" type="file"/&gt;
      &lt;map:transform src="xsl/department_listing.xsl" type="xslt2" &gt;
        &lt;map:parameter name="relative_path" value="{baselink:SitemapBaseLink}"/&gt;
      &lt;/map:transform&gt;
      &lt;map:serialize type="xhtml" /&gt;
    &lt;/map:match&gt;
  </code></pre>
  
  <p>And then on the top of the common xsl I have this </p>
  
  <pre><code>&lt;xsl:param name="relative_path"/&gt;
  </code></pre>
  
  <p>later I am using the param like this:</p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
          &lt;html&gt;
              &lt;head&gt;
                  &lt;title&gt;&lt;xsl:value-of select="$displaytitle"/&gt;&lt;/title&gt;
                   &lt;link rel="stylesheet" type="text/css" href="http://localhost:8080/cocoon/assignment2/css/style.css" /&gt; 
                  &lt;link rel="stylesheet" type="{$relative_path}css/style.css" /&gt;
              &lt;/head&gt;
  </code></pre>
  
  <p>The problem is that $relative_path is not producing any value, the variable is empty and I am not sure how to fix it.</p>
  
  <p>Thanks in advance for your help.</p>