Логотип

Документация по макросам и шаблонам UMI.CMS

Итоговый набор шаблонов

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output encoding="UTF-8" method="html" indent="yes"/>
  
  <xsl:template match="/">
    <html>
      <head></head>
      <body>
      
        <div class="content">
          <xsl:apply-templates select="result" />
        </div>

      </body>
    </html>
  </xsl:template>



<xsl:template match="result[@module = 'content'][@method = 'notfound' or @method = 'sitemap']">
  <xsl:apply-templates select="document('udata://content/sitemap/')/udata/items" mode="sitemap"/>
</xsl:template>



<xsl:template match="items" mode="sitemap">
  <ul>
    <xsl:apply-templates select="item" mode="sitemap"/>
  </ul>
</xsl:template>



<xsl:template match="item" mode="sitemap">
  <li>
    <a href="{@link}">
      <xsl:value-of select="@name" />
    </a>
    <xsl:apply-templates select="items" mode="sitemap"/>
  </li>
</xsl:template>
  
</xsl:stylesheet>