Делаю меню, вот xsl код:
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:template match="/">
<xsl:apply-templates select="/document"/>
</xsl:template>
<xsl:template match="/document">
<xsl:variable name="parent_group_id" select="blocks/parent_group_id"/>
<xsl:apply-templates select=".//group[@parent_id=$parent_group_id]"/>
</xsl:template>
<xsl:template match="group">
<xsl:variable name="current_group_id" select="/document/ТекущаяГруппа"/>
<div class="lm">
<div class="lc">
<xsl:choose>
<xsl:when test="$current_group_id = @id or count(.//group[@id=$current_group_id])=1">
<a href="{/document/blocks/url}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<xsl:if test="count_all_groups > 0">
<ul>
<xsl:apply-templates select="group"/>
</ul>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<a href="{/document/blocks/url}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
</xsl:otherwise>
</xsl:choose>
</div>
<div class="l1"></div><div class="l2"></div><div class="l3"></div><div class="l4"></div>
</div>
</xsl:template>
<!--Шаблон для подразделов-->
<xsl:template match="sub_group">
<li><a href="{/document/blocks/url}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a></li>
</xsl:template>
</xsl:stylesheet>
Так вот там я вывожу подразделы через
<xsl:apply-templates select="group"/>
нужно к нему применить шаблон
sub_group, насколько понимаю надо прописать так
<xsl:apply-templates select="group" mode="sub_group"/>
но не работает и к тому же выводится просто инфа из xml, короче ника кне понимаю заставить работать.
Вывожу через код:
<?php
$InformationSystem = & singleton('InformationSystem');
$external_propertys=array();
$property = array();
$property['xml_show_group_type'] = 'all';
$external_propertys['ОтображатьСсылкуНаАрхив']=0;
$external_propertys['ОтображатьСсылкиНаСледующиеСтраницы']=0;
$item_count = 3;
$InformationSystemId = 15;
$rez = array();
$rez = $InformationSystem->GetInformationFromPath($InformationSystemId);
$external_propertys['ТекущаяГруппа'] = $rez['group'];
$InformationGroupId = false; // false - из всех групп, 0 - из корневой группы
$InformationSystem->ShowInformationSystem($InformationSystemId, $InformationGroupId,'ЛевоеМеню',$item_count,0,$external_propertys, $property);
?>
Подскажите пожалуйста