Группы ИС в меню сайта

#
Группы ИС в меню сайта
Добрый день.
Странная ситуация. Есть сайт где к узлу привязана ИС, с группами и элементами. Все видимые.
Нужно отобразить ГРУППЫ ИС как пункты подменю.

Код:
<?php
// Верхнее меню
$Structure_Controller_Show = new Structure_Controller_Show(
Core_Entity::factory('Site', CURRENT_SITE));

$Structure_Controller_Show ->addEntity(Core::factory('Core_Xml_Entity')
      ->name('current_url')
      ->value($_SERVER["REQUEST_URI"]));
$Structure_Controller_Show->xsl(Core_Entity::factory('Xsl')
   ->getByName('ВыпадающееМеню'))
        ->showInformationsystemGroups(TRUE)
        ->showInformationsystemItems(FALSE)
        ->forbiddenTags(array('text'))
        ->level('1')
   ->menu('3')
        ->show();
?>


XLS:
===
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:hostcms="http://www.hostcms.ru/"
   exclude-result-prefixes="hostcms">
   <xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
   
   <xsl:template match="/site">
      <ul class="flexy-menu thick">
         <!-- Выбираем узлы структуры первого уровня -->
         <xsl:apply-templates select="structure[show=1]"/>
      </ul>
   </xsl:template>
   
   <!-- Запишем в константу ID структуры, данные для которой будут выводиться пользователю -->
   <xsl:variable name="current_structure_id" select="/site/current_structure_id"/>
   <xsl:variable name="current_structure_url" select="/site/current_url"/>
   
   <xsl:template match="*">
      <!-- Шаблон выборки дочерних узлов -->
      <xsl:variable name="sub" select="structure[@id][show=1]" />
      <xsl:variable name="subitem" select="informationsystem_group[@id][show=1][active=1]/name" />
      <xsl:value-of disable-output-escaping="yes" select="$subitem"/>
      <li>
         <xsl:attribute name="class">
            <xsl:choose>
               <xsl:when test="$current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1">active</xsl:when>
               <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
         </xsl:attribute>
         
         <!-- Определяем адрес ссылки -->
         <xsl:variable name="link">
            <xsl:choose>
               <!-- Если внутренняя ссылка -->
               <xsl:when test="link != ''">
                  <xsl:value-of disable-output-escaping="yes" select="link"/>
               </xsl:when>
               <!-- Если внешняя ссылка -->
               <xsl:otherwise>
                  <xsl:value-of disable-output-escaping="yes" select="url"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         
         <xsl:variable name="parent">
            <xsl:choose>
               <!-- Если внутренняя ссылка -->
               <xsl:when test="parent_id">
                  <xsl:value-of disable-output-escaping="yes" select="parent_id"/>
               </xsl:when>
               <!-- Если внешняя ссылка -->
               <xsl:otherwise>100000</xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         <!-- Показывать ссылку? -->
         <a href="{$link}">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </a>
         <xsl:choose>
         <xsl:when test="$current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1"><div class="arrow-down"></div></xsl:when>
            <xsl:otherwise></xsl:otherwise>
         </xsl:choose>
         
         
         <xsl:if test="$sub">
            <ul>
               <xsl:if test="$sub">
                  
                  <xsl:apply-templates select="structure[show=1]" match="sub"/>
               </xsl:if>
               <xsl:if test="$subitem">
                  <xsl:apply-templates select="informationsystem_group[show=1]" match="sub"/>
               </xsl:if>
               
            </ul>
         </xsl:if>
      </li>
   </xsl:template>
   
   <xsl:template  match="sub">
      
      <a href="{$link}">
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>
   </xsl:template>
   
</xsl:stylesheet>


Группы не отображаются. Парадокс в том, что этот код работал на другом сайте. Проверил все, отличий нет. Либо глаз замылен, либо что-то упускаю.

Буду признателен за совет.


Авторизация