2 вопроса по доске объявлений

#
Re: 2 вопроса по доске объявлений
<?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:decimal-format name="my" decimal-separator="," grouping-separator=" "/>
   
   <xsl:template match="/">
      <xsl:apply-templates select="/shop"/>
   </xsl:template>
   
   <!-- Шаблон для магазина -->
   <xsl:template match="/shop">
      <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
      <xsl:variable name="parent_group_id" select="@current_group_id"/>
      
      <!-- Если в находимся корне - выводим название информационной системы -->
      <xsl:if test="$parent_group_id=0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </h1>
      </xsl:if>
      
      <!-- Если в находимся в группе - выводим название группы -->
      <xsl:if test="$parent_group_id!=0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/name"/>
         </h1>
      </xsl:if>
      
      <!-- Обработка выбранных тэгов -->
      <xsl:if test="count(selected_tags/tag) = 1">
      <h2>Метка &#x97; <strong><xsl:value-of select="selected_tags/tag/tag_name"/></strong>.</h2>
      </xsl:if>
      
      <!-- Путь к группе -->
      <!-- <div class="path">
         <xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/>
      </div> -->
      
      <!-- Сообщение -->
      <xsl:if test="message/node()">
         <div id="message">
            <xsl:value-of disable-output-escaping="yes" select="message" />
         </div>
      </xsl:if>
      
      <xsl:if test="$parent_group_id!=0">
         <!--  Метка для перехода при выводе сообщения -->
         <a name="FocusAddItemMessage"></a>
         
         <div id="ShowAddComment">
            <a onclick="if (document.getElementById('AddItemForm').innerHTML == '') sendBackgroundRequest('{/shop/path}?action=show_form_add_item&amp;group_id={$parent_group_id}', 'get', callbackfunction_showFormAddItem); else cr('AddItemForm'); return false;" href="javascript:void(0)">Добавить объявление в этот раздел</a>
         </div>
         
         <!-- Блок для вывода уведомлений о добавлении объявления или ошибке добавления -->
         <div id="AddItemMessage"></div>
         
         <div id="AddItemForm" style="display: block"></div>
      </xsl:if>
      
      <xsl:variable name="count">1</xsl:variable>
      
      <!-- Отображение подгрупп данной группы, только если подгруппы есть и не идет фильтра по меткам -->
      <xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) &gt; 0">
         <table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
               <td valign="top">
                  <xsl:apply-templates select="//group[@parent=$parent_group_id]">
                     <xsl:with-param name="style_font">shop_root_title</xsl:with-param>
                  </xsl:apply-templates>
               </td>
            </tr>
         </table>
      </xsl:if>
      
      <xsl:if test="count(item) &gt; 0  or apply_filter = 1">
         <form method="get" action="./">
            
            
            
            
            <!-- Определяем ссылку с параметрами фильтра -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <xsl:apply-templates select="item" />
            
            <xsl:if test="count_items &gt; 0 and items_on_page &gt; 0">
               <p>
                  <xsl:call-template name="for">
                     <xsl:with-param name="items_on_page" select="items_on_page"/>
                     <xsl:with-param name="current_page" select="current_page"/>
                     <xsl:with-param name="count_items" select="count_items"/>
                     <xsl:with-param name="visible_pages" select="5"/>
                  </xsl:call-template>
               </p>
               <div style="clear: both"></div>
            </xsl:if>
            
         </form>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для фильтра производителей -->
   <xsl:template match="producerslist/producer">
      <option value="{@id}">
         <xsl:if test="@id = /shop/producer_id">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </option>
   </xsl:template>
   
   <!-- Шаблон для фильтра продавцов -->
   <xsl:template match="sallers/saller">
      <option value="{@id}">
         <xsl:if test="@id = /shop/saller_id">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="sallers_name"/>
      </option>
   </xsl:template>
   
   <!-- Шаблон для фильра по дополнительным свойствам -->
   <xsl:template match="properties_for_group/property">
      
      <xsl:variable name="nodename">property_id_<xsl:value-of select="@id"/></xsl:variable>
      <td>
         <xsl:value-of disable-output-escaping="yes" select="property_name"/>&#xA0;
         <xsl:if test="property_show_kind = 1">
            <!-- Отображаем поле ввода -->
            <br/>
            <input type="text" name="property_id_{@id}">
               
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="value">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
         </xsl:if>
         <xsl:if test="property_show_kind = 2">
            <!-- Отображаем список -->
            <br/>
            <select name="property_id_{@id}">
               <option value="0">...</option>-->
               <xsl:apply-templates select="list_items/list_item"/>
            </select>
         </xsl:if>
         <xsl:if test="property_show_kind = 3">
            <!-- Отображаем переключатели -->
            <br/>
            <input type="radio" name="property_id_{@id}" value="0" id="id_prop_radio_{@id}_0"></input>
            <label for="id_prop_radio_{@id}_0">Любой вариант</label>
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         <xsl:if test=" property_show_kind = 4">
            <!-- Отображаем флажки -->
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         
         <xsl:if test=" property_show_kind = 5">
            <!-- Отображаем флажок -->
            <br/>
            <input type="checkbox" name="property_id_{@id}" id="property_id_{@id}" style="padding-top:4px">
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="checked">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
            <label for="property_id_{@id}">Да</label>
         </xsl:if>
      </td>
      <xsl:if test="position() mod 6 = 0">
         <xsl:text disable-output-escaping="yes">
            &lt;/tr&gt;
            &lt;tr valign="top"&gt;
         </xsl:text>
      </xsl:if>
   </xsl:template>
   
   <xsl:template match="list_items/list_item">
      <xsl:if test="../../property_show_kind = 2">
         <!-- Отображаем список -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <option value="{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <xsl:attribute name="selected">
               </xsl:attribute>
            </xsl:if>
            <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
         </option>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 3">
         <!-- Отображаем переключатели -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <br/>
         <input type="radio" name="property_id_{../../@id}" value="{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <!--<xsl:attribute name="checked"> </xsl:attribute>-->
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 4">
         <!-- Отображаем флажки -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/>_item_id_<xsl:value-of select="@id"/></xsl:variable>
         <br/>
         <input type="checkbox" name="property_id_{../../@id}_item_id_{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <!--<xsl:attribute name="checked"> </xsl:attribute>-->
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
   </xsl:template>
   
   <!-- Цикл с шагом 10 для select'a количества элементов на страницу -->
   <xsl:template name="for_on_page">
      <xsl:param name="i" select="0"/>
      <xsl:param name="n"/>
      
      <option value="{$i}">
         <xsl:if test="$i = /shop/on_page">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="$i"/>
      </option>
      
      <xsl:if test="$n &gt; $i">
         <!-- Рекурсивный вызов шаблона -->
         <xsl:call-template name="for_on_page">
            <xsl:with-param name="i" select="$i + 10"/>
            <xsl:with-param name="n" select="$n"/>
         </xsl:call-template>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для групп товара -->
   <xsl:template match="group">
      
      <xsl:variable name="parent_id" select="@parent"/>
      
      <div style="margin-bottom: 15px;">
         <a href="{/shop/path}{fullpath}" style="font-weight: bold">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>&#xA0;<span style="color: #aaaaaa">(<xsl:value-of select="count_all_items"/>)</span>
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="description"/>
         
         <xsl:if test="count(group) &gt; 1">
            <xsl:apply-templates select="group" mode="sub_group"/>
         </xsl:if>
      </div>
      
      <xsl:if test="position()= round(count(//group[@parent = $parent_id]) div 2)">
         <xsl:text disable-output-escaping="yes">
            &lt;/td&gt;
            &lt;td valign="top" width="50%"&gt;
         </xsl:text>
      </xsl:if>
      
   </xsl:template>
   
   <!-- Шаблон для подразделов -->
   <xsl:template match="group" mode="sub_group">
      <a href="{/shop/path}{fullpath}">
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>
      <xsl:variable name="parent_id" select="@parent"/>
      <!-- Ставим запятую после группы, за которой следуют еще группы из данной родителской группы -->
      <xsl:if test="position() != last() and count(//group[@parent = $parent_id]) &gt; 1">,&#xA0;</xsl:if>
   </xsl:template>
   
   
   <!-- Шаблон для товара -->
   <xsl:template match="item">
      
      <table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
         <tr>
            <xsl:if test="small_image != ''">
               <xsl:variable name="td_image_width" select="small_image/@width +10"/>
               <td class="cat_t" style="width:{$td_image_width}px" valign="top" align="center">
                  <!-- Изображение для товара, если есть -->
                  <xsl:if test="small_image/node() and small_image!=''">
                     <a href="{/shop/path}{fullpath}{path}/">
                        <img src="{small_image}" style="border: 1px solid #dadada"/>
                     </a>
                  </xsl:if>
               </td>
            </xsl:if>
            
            <td style="padding-left:12px;" valign="middle">
               <div>
                  <a href="{/shop/path}{fullpath}{path}/" class="cat_title">
                     <span style="font-size: 13pt">
                        <b>
                           <xsl:value-of disable-output-escaping="yes" select="name"/>
                        </b>
                     </span>
                  </a>
               </div>
               
               
               <div style="margin-top:4px;margin-bottom:10px;margin-left:5px;font-size:11px;"></div>
            </td>
            <td width="128" valign="middle">
               <xsl:value-of disable-output-escaping="yes" select="property[@id = 61]/value"/>
            </td>
            <!-- Переход на новую строку после каждого 2-го инфоэлемента -->
            <xsl:if test="position() mod 2 = 0">
               <xsl:text disable-output-escaping="yes">
                  &lt;/tr&gt;
                  &lt;tr&gt;
               </xsl:text>
            </xsl:if>
         </table>
      </xsl:template>
      
      <!-- Шаблон для модификаций -->
      <xsl:template match="modifications/item">
         <tr>
            <td>
               <!-- Название модификации -->
               <a href="{/shop/path}{fullpath}{path}/">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </td>
            <td>
               <!-- Цена модификации -->
               <xsl:choose>
                  <xsl:when test="price != 0">
                     <xsl:value-of disable-output-escaping="yes" select="price"/>&#xA0;
                     <!-- Валюта товара -->
                     <xsl:value-of disable-output-escaping="yes" select="currency"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>
            </td>
         </tr>
      </xsl:template>
      
      <!-- Шаблон для скидки -->
      <xsl:template match="discount">
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="name"/>&#xA0;
         <xsl:value-of disable-output-escaping="yes" select="value"/>%</xsl:template>
      
      
      <!-- Цикл для вывода строк ссылок -->
      <xsl:template name="for">
         <xsl:param name="i" select="0"/>
         <xsl:param name="items_on_page"/>
         <xsl:param name="current_page"/>
         <xsl:param name="count_items"/>
         <xsl:param name="visible_pages"/>
         
         <xsl:variable name="n" select="$count_items div $items_on_page"/>
         
         <!-- Считаем количество выводимых ссылок перед текущим элементом -->
         <xsl:variable name="pre_count_page">
            <xsl:choose>
               <xsl:when test="$current_page &gt; ($n - (round($visible_pages div 2) - 1))">
                  <xsl:value-of select="$visible_pages - ($n - $current_page)"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:value-of select="round($visible_pages div 2) - 1"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         
         <!-- Считаем количество выводимых ссылок после текущего элемента -->
         <xsl:variable name="post_count_page">
            <xsl:choose>
               <xsl:when test="0 &gt; $current_page - (round($visible_pages div 2) - 1)">
                  <xsl:value-of select="$visible_pages - $current_page - 1"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:choose>
                     <xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
                        <xsl:value-of select="$visible_pages div 2"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:value-of select="round($visible_pages div 2) - 1"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         
         <xsl:if test="$i = 0 and $current_page != 0">
            <span class="ctrl">
               &#8592; Ctrl
            </span>
         </xsl:if>
         
         <xsl:if test="$i >= $n and ($n - 1) > $current_page">
            <span class="ctrl">
               Ctrl &#8594;
            </span>
         </xsl:if>
         
         <xsl:if test="$count_items &gt; $items_on_page and $n &gt; $i">
            
            <!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
            <xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
            
            <!-- Путь для тэга -->
            <xsl:variable name="tag_path">
               <xsl:if test="count(/shop/selected_tags/tag) = 1">tag/<xsl:value-of select="/shop/selected_tags/tag/tag_path_name"/>/</xsl:if>
            </xsl:variable>
            
            <!-- Определяем группу для формирования адреса ссылки -->
            <xsl:variable name="group_link">
               <xsl:choose>
                  <!-- Если группа не корневая (!=0) -->
                  <xsl:when test="$parent_group_id != 0">
                     <xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/>
                  </xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем адрес ссылки -->
            <xsl:variable name="number_link">
               <xsl:choose>
                  <!-- Если не нулевой уровень -->
                  <xsl:when test="$i != 0">page-<xsl:value-of select="$i+1"/>/</xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Передаем фильтр -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Данные для стрелок сортировки -->
            <xsl:variable name="arrows">
               <xsl:choose>
                  <xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
                     <xsl:choose>
                        <!-- Стрелка вверх -->
                        <xsl:when test="/shop/order_direction = 'ASC'">
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=1</xsl:when>
                        <!-- Стрелка вниз -->
                        <xsl:otherwise>
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=2</xsl:otherwise>
                     </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Ставим ссылку на страницу-->
            <xsl:if test="$i != $current_page">
               
               <!-- Выводим ссылку на первую страницу -->
               <xsl:if test="$current_page - $pre_count_page &gt; 0 and $i = 0">
                  <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2190;</a>
               </xsl:if>
               
               <xsl:if test="$i &gt;= ($current_page - $pre_count_page) and ($current_page + $post_count_page) &gt;= $i">
                  <!-- Выводим ссылки на видимые страницы -->
                  <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link">
                     <xsl:value-of select="$i + 1"/>
                  </a>
               </xsl:if>
               
               <!-- Выводим ссылку на последнюю страницу -->
               <xsl:if test="$i+1 &gt;= $n and $n &gt; ($current_page + 1 + $post_count_page)">
                  <xsl:choose>
                     <xsl:when test="$n &gt; round($n)">
                        <!-- Выводим ссылку на последнюю страницу -->
                        <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}page-{round($n+1)}/" class="page_link" style="text-decoration: none;">&#x2192;</a>
                     </xsl:when>
                     <xsl:otherwise>
                        <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2192;</a>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:if>
            </xsl:if>
            
            <!-- Ссылка на предыдущую страницу для Ctrl + влево -->
            <xsl:if test="$current_page != 0 and $i = $current_page">
               <xsl:variable name="prev_number_link">
                  <xsl:choose>
                     <!-- Если не нулевой уровень -->
                     <xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$i"/>/</xsl:when>
                     <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                     <xsl:otherwise></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               
               <a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev"></a>
            </xsl:if>
            
            <!-- Ссылка на следующую страницу для Ctrl + вправо -->
            <xsl:if test="($n - 1) > $current_page and $i = $current_page">
               <a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next"></a>
            </xsl:if>
            
            <!-- Не ставим ссылку на страницу-->
            <xsl:if test="$i = $current_page">
               <span class="current">
                  <xsl:value-of select="$i+1"/>
               </span>
            </xsl:if>
            
            <!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
            <xsl:call-template name="for">
               <xsl:with-param name="i" select="$i + 1"/>
               <xsl:with-param name="items_on_page" select="$items_on_page"/>
               <xsl:with-param name="current_page" select="$current_page"/>
               <xsl:with-param name="count_items" select="$count_items"/>
               <xsl:with-param name="visible_pages" select="$visible_pages"/>
            </xsl:call-template>
         </xsl:if>
      </xsl:template>
      
      <!-- Шаблон выводит рекурсивно ссылки на группы инф. элемента -->
      <xsl:template match="group" mode="goup_path">
         <xsl:param name="parent_id" select="@parent"/>
         
         <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
         <xsl:param name="parent_group_id" select="/shop/@current_group_id"/>
         
         <xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
         
         <xsl:if test="@parent=0">
            <a href="{/shop/path}">
               <xsl:value-of select="/shop/name"/>
            </a>
         </xsl:if>
         
         <span class="path_arrow">&#x2192;</span>
         
         <xsl:choose>
            <xsl:when test="$parent_group_id = @id">
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:when>
            <xsl:otherwise>
               <a href="{/shop/path}{fullpath}">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:template>
   </xsl:stylesheet>
#
Re: 2 вопроса по доске объявлений
<table border="0" cellspacing="0" cellpadding="2">
   <tr>
        <xsl:apply-templates select="item" />
   </tr>
   </table>

да, забыл...но при подстановке тот же результат...)
#
Re: 2 вопроса по доске объявлений
MAP!O, дык, не так же надо-то!
Во-первых, вместо:
<xsl:apply-templates select="item" />

используйте:
<table border="0" cellspacing="0" cellpadding="2">
   <tr>
        <xsl:apply-templates select="item" />
   </tr>
   </table>


Во-вторых, вместо:
<!-- Шаблон для товара -->
   <xsl:template match="item">
      
      <table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
         <tr>
            <xsl:if test="small_image != ''">
               <xsl:variable name="td_image_width" select="small_image/@width +10"/>
               <td class="cat_t" style="width:{$td_image_width}px" valign="top" align="center">
                  <!-- Изображение для товара, если есть -->
                  <xsl:if test="small_image/node() and small_image!=''">
                     <a href="{/shop/path}{fullpath}{path}/">
                        <img src="{small_image}" style="border: 1px solid #dadada"/>
                     </a>
                  </xsl:if>
               </td>
            </xsl:if>
            
            <td style="padding-left:12px;" valign="middle">
               <div>
                  <a href="{/shop/path}{fullpath}{path}/" class="cat_title">
                     <span style="font-size: 13pt">
                        <b>
                           <xsl:value-of disable-output-escaping="yes" select="name"/>
                        </b>
                     </span>
                  </a>
               </div>
              
              
               <div style="margin-top:4px;margin-bottom:10px;margin-left:5px;font-size:11px;"></div>
            </td>
            <td width="128" valign="middle">
               <xsl:value-of disable-output-escaping="yes" select="property[@id = 61]/value"/>
            </td>
            <!-- Переход на новую строку после каждого 2-го инфоэлемента -->
            <xsl:if test="position() mod 2 = 0">
               <xsl:text disable-output-escaping="yes">
                  &lt;/tr&gt;
                  &lt;tr&gt;
               </xsl:text>
            </xsl:if>
         </table>
      </xsl:template>

используйте:
<!-- Шаблон для товара -->
   <xsl:template match="item">
      <td>

      <table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
         <tr>
            <xsl:if test="small_image != ''">
               <xsl:variable name="td_image_width" select="small_image/@width +10"/>
               <td class="cat_t" style="width:{$td_image_width}px" valign="top" align="center">
                  <!-- Изображение для товара, если есть -->
                  <xsl:if test="small_image/node() and small_image!=''">
                     <a href="{/shop/path}{fullpath}{path}/">
                        <img src="{small_image}" style="border: 1px solid #dadada"/>
                     </a>
                  </xsl:if>
               </td>
            </xsl:if>
            
            <td style="padding-left:12px;" valign="middle">
               <div>
                  <a href="{/shop/path}{fullpath}{path}/" class="cat_title">
                     <span style="font-size: 13pt">
                        <b>
                           <xsl:value-of disable-output-escaping="yes" select="name"/>
                        </b>
                     </span>
                  </a>
               </div>
              
              
               <div style="margin-top:4px;margin-bottom:10px;margin-left:5px;font-size:11px;"></div>
            </td>
            <td width="128" valign="middle">
               <xsl:value-of disable-output-escaping="yes" select="property[@id = 61]/value"/>
            </td>
         </table>
</td>
<!-- Переход на новую строку после каждого 2-го инфоэлемента -->
            <xsl:if test="position() mod 2 = 0">
               <xsl:text disable-output-escaping="yes">
                  &lt;/tr&gt;
                  &lt;tr&gt;
               </xsl:text>
            </xsl:if>
      </xsl:template>
#
Re: 2 вопроса по доске объявлений
<?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:decimal-format name="my" decimal-separator="," grouping-separator=" "/>
   
   <xsl:template match="/">
      <xsl:apply-templates select="/shop"/>
   </xsl:template>
   
   <!-- Шаблон для магазина -->
   <xsl:template match="/shop">
      <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
      <xsl:variable name="parent_group_id" select="@current_group_id"/>
      
      <!-- Если в находимся корне - выводим название информационной системы -->
      <xsl:if test="$parent_group_id=0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </h1>
      </xsl:if>
      
      <!-- Если в находимся в группе - выводим название группы -->
      <xsl:if test="$parent_group_id!=0">
         <h1>
            <xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/name"/>
         </h1>
      </xsl:if>
      
      <!-- Обработка выбранных тэгов -->
      <xsl:if test="count(selected_tags/tag) = 1">
      <h2>Метка &#x97; <strong><xsl:value-of select="selected_tags/tag/tag_name"/></strong>.</h2>
      </xsl:if>
      
      <!-- Путь к группе -->
      <!-- <div class="path">
         <xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/>
      </div> -->
      
      <!-- Сообщение -->
      <xsl:if test="message/node()">
         <div id="message">
            <xsl:value-of disable-output-escaping="yes" select="message" />
         </div>
      </xsl:if>
      
      <xsl:if test="$parent_group_id!=0">
         <!--  Метка для перехода при выводе сообщения -->
         <a name="FocusAddItemMessage"></a>
         
         <div id="ShowAddComment">
            <a onclick="if (document.getElementById('AddItemForm').innerHTML == '') sendBackgroundRequest('{/shop/path}?action=show_form_add_item&amp;group_id={$parent_group_id}', 'get', callbackfunction_showFormAddItem); else cr('AddItemForm'); return false;" href="javascript:void(0)">Добавить объявление в этот раздел</a>
         </div>
         
         <!-- Блок для вывода уведомлений о добавлении объявления или ошибке добавления -->
         <div id="AddItemMessage"></div>
         
         <div id="AddItemForm" style="display: block"></div>
      </xsl:if>
      
      <xsl:variable name="count">1</xsl:variable>
      
      <!-- Отображение подгрупп данной группы, только если подгруппы есть и не идет фильтра по меткам -->
      <xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) &gt; 0">
         <table width="100%" border="0" cellpadding="3" cellspacing="0">
            <tr>
               <td valign="top">
                  <xsl:apply-templates select="//group[@parent=$parent_group_id]">
                     <xsl:with-param name="style_font">shop_root_title</xsl:with-param>
                  </xsl:apply-templates>
               </td>
            </tr>
         </table>
      </xsl:if>
      
      <xsl:if test="count(item) &gt; 0  or apply_filter = 1">
         <form method="get" action="./">
            
            
            
            
            <!-- Определяем ссылку с параметрами фильтра -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <table border="0" cellspacing="0" cellpadding="2">
               <tr>
                  <xsl:apply-templates select="item" />
               </tr>
            </table>
            
            <xsl:if test="count_items &gt; 0 and items_on_page &gt; 0">
               <p>
                  <xsl:call-template name="for">
                     <xsl:with-param name="items_on_page" select="items_on_page"/>
                     <xsl:with-param name="current_page" select="current_page"/>
                     <xsl:with-param name="count_items" select="count_items"/>
                     <xsl:with-param name="visible_pages" select="5"/>
                  </xsl:call-template>
               </p>
               <div style="clear: both"></div>
            </xsl:if>
            
         </form>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для фильтра производителей -->
   <xsl:template match="producerslist/producer">
      <option value="{@id}">
         <xsl:if test="@id = /shop/producer_id">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </option>
   </xsl:template>
   
   <!-- Шаблон для фильтра продавцов -->
   <xsl:template match="sallers/saller">
      <option value="{@id}">
         <xsl:if test="@id = /shop/saller_id">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="sallers_name"/>
      </option>
   </xsl:template>
   
   <!-- Шаблон для фильра по дополнительным свойствам -->
   <xsl:template match="properties_for_group/property">
      
      <xsl:variable name="nodename">property_id_<xsl:value-of select="@id"/></xsl:variable>
      <td>
         <xsl:value-of disable-output-escaping="yes" select="property_name"/>&#xA0;
         <xsl:if test="property_show_kind = 1">
            <!-- Отображаем поле ввода -->
            <br/>
            <input type="text" name="property_id_{@id}">
               
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="value">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
         </xsl:if>
         <xsl:if test="property_show_kind = 2">
            <!-- Отображаем список -->
            <br/>
            <select name="property_id_{@id}">
               <option value="0">...</option>-->
               <xsl:apply-templates select="list_items/list_item"/>
            </select>
         </xsl:if>
         <xsl:if test="property_show_kind = 3">
            <!-- Отображаем переключатели -->
            <br/>
            <input type="radio" name="property_id_{@id}" value="0" id="id_prop_radio_{@id}_0"></input>
            <label for="id_prop_radio_{@id}_0">Любой вариант</label>
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         <xsl:if test=" property_show_kind = 4">
            <!-- Отображаем флажки -->
            <xsl:apply-templates select="list_items/list_item"/>
         </xsl:if>
         
         <xsl:if test=" property_show_kind = 5">
            <!-- Отображаем флажок -->
            <br/>
            <input type="checkbox" name="property_id_{@id}" id="property_id_{@id}" style="padding-top:4px">
               <xsl:if test="/shop/*[name()=$nodename] != ''">
                  <xsl:attribute name="checked">
                     <xsl:value-of select="/shop/*[name()=$nodename]"/>
                  </xsl:attribute>
               </xsl:if>
            </input>
            <label for="property_id_{@id}">Да</label>
         </xsl:if>
      </td>
      <xsl:if test="position() mod 6 = 0">
         <xsl:text disable-output-escaping="yes">
            &lt;/tr&gt;
            &lt;tr valign="top"&gt;
         </xsl:text>
      </xsl:if>
   </xsl:template>
   
   <xsl:template match="list_items/list_item">
      <xsl:if test="../../property_show_kind = 2">
         <!-- Отображаем список -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <option value="{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <xsl:attribute name="selected">
               </xsl:attribute>
            </xsl:if>
            <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
         </option>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 3">
         <!-- Отображаем переключатели -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
         <br/>
         <input type="radio" name="property_id_{../../@id}" value="{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <!--<xsl:attribute name="checked"> </xsl:attribute>-->
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
      <xsl:if test="../../property_show_kind = 4">
         <!-- Отображаем флажки -->
         <xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/>_item_id_<xsl:value-of select="@id"/></xsl:variable>
         <br/>
         <input type="checkbox" name="property_id_{../../@id}_item_id_{@id}" id="id_property_id_{../../@id}_{@id}">
            <xsl:if test="/shop/*[name()=$nodename] = @id">
               <!--<xsl:attribute name="checked"> </xsl:attribute>-->
            </xsl:if>
            <label for="id_property_id_{../../@id}_{@id}">
               <xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
            </label>
         </input>
      </xsl:if>
   </xsl:template>
   
   <!-- Цикл с шагом 10 для select'a количества элементов на страницу -->
   <xsl:template name="for_on_page">
      <xsl:param name="i" select="0"/>
      <xsl:param name="n"/>
      
      <option value="{$i}">
         <xsl:if test="$i = /shop/on_page">
            <xsl:attribute name="selected">
            </xsl:attribute>
         </xsl:if>
         <xsl:value-of select="$i"/>
      </option>
      
      <xsl:if test="$n &gt; $i">
         <!-- Рекурсивный вызов шаблона -->
         <xsl:call-template name="for_on_page">
            <xsl:with-param name="i" select="$i + 10"/>
            <xsl:with-param name="n" select="$n"/>
         </xsl:call-template>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для групп товара -->
   <xsl:template match="group">
      
      <xsl:variable name="parent_id" select="@parent"/>
      
      <div style="margin-bottom: 15px;">
         <a href="{/shop/path}{fullpath}" style="font-weight: bold">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>&#xA0;<span style="color: #aaaaaa">(<xsl:value-of select="count_all_items"/>)</span>
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="description"/>
         
         <xsl:if test="count(group) &gt; 1">
            <xsl:apply-templates select="group" mode="sub_group"/>
         </xsl:if>
      </div>
      
      <xsl:if test="position()= round(count(//group[@parent = $parent_id]) div 2)">
         <xsl:text disable-output-escaping="yes">
            &lt;/td&gt;
            &lt;td valign="top" width="50%"&gt;
         </xsl:text>
      </xsl:if>
      
   </xsl:template>
   
   <!-- Шаблон для подразделов -->
   <xsl:template match="group" mode="sub_group">
      <a href="{/shop/path}{fullpath}">
         <xsl:value-of disable-output-escaping="yes" select="name"/>
      </a>
      <xsl:variable name="parent_id" select="@parent"/>
      <!-- Ставим запятую после группы, за которой следуют еще группы из данной родителской группы -->
      <xsl:if test="position() != last() and count(//group[@parent = $parent_id]) &gt; 1">,&#xA0;</xsl:if>
   </xsl:template>
   
   
   <!-- Шаблон для товара -->
   <xsl:template match="item">
      <td>
         
         <table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
            <tr>
               <xsl:if test="small_image != ''">
                  <xsl:variable name="td_image_width" select="small_image/@width +10"/>
                  <td class="cat_t" style="width:{$td_image_width}px" valign="top" align="center">
                     <!-- Изображение для товара, если есть -->
                     <xsl:if test="small_image/node() and small_image!=''">
                        <a href="{/shop/path}{fullpath}{path}/">
                           <img src="{small_image}" style="border: 1px solid #dadada"/>
                        </a>
                     </xsl:if>
                  </td>
               </xsl:if>
               
               <td style="padding-left:12px;" valign="middle">
                  <div>
                     <a href="{/shop/path}{fullpath}{path}/" class="cat_title">
                        <span style="font-size: 13pt">
                           <b>
                              <xsl:value-of disable-output-escaping="yes" select="name"/>
                           </b>
                        </span>
                     </a>
                  </div>
                  
                  
                  <div style="margin-top:4px;margin-bottom:10px;margin-left:5px;font-size:11px;"></div>
               </td>
               <td width="128" valign="middle">
                  <xsl:value-of disable-output-escaping="yes" select="property[@id = 61]/value"/>
               </td>
            </table>
         </td>
         <!-- Переход на новую строку после каждого 2-го инфоэлемента -->
         <xsl:if test="position() mod 2 = 0">
            <xsl:text disable-output-escaping="yes">
               &lt;/tr&gt;
               &lt;tr&gt;
            </xsl:text>
         </xsl:if>
      </xsl:template>
      
      <!-- Шаблон для модификаций -->
      <xsl:template match="modifications/item">
         <tr>
            <td>
               <!-- Название модификации -->
               <a href="{/shop/path}{fullpath}{path}/">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </td>
            <td>
               <!-- Цена модификации -->
               <xsl:choose>
                  <xsl:when test="price != 0">
                     <xsl:value-of disable-output-escaping="yes" select="price"/>&#xA0;
                     <!-- Валюта товара -->
                     <xsl:value-of disable-output-escaping="yes" select="currency"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>
            </td>
         </tr>
      </xsl:template>
      
      <!-- Шаблон для скидки -->
      <xsl:template match="discount">
         <br/>
         <xsl:value-of disable-output-escaping="yes" select="name"/>&#xA0;
         <xsl:value-of disable-output-escaping="yes" select="value"/>%</xsl:template>
      
      
      <!-- Цикл для вывода строк ссылок -->
      <xsl:template name="for">
         <xsl:param name="i" select="0"/>
         <xsl:param name="items_on_page"/>
         <xsl:param name="current_page"/>
         <xsl:param name="count_items"/>
         <xsl:param name="visible_pages"/>
         
         <xsl:variable name="n" select="$count_items div $items_on_page"/>
         
         <!-- Считаем количество выводимых ссылок перед текущим элементом -->
         <xsl:variable name="pre_count_page">
            <xsl:choose>
               <xsl:when test="$current_page &gt; ($n - (round($visible_pages div 2) - 1))">
                  <xsl:value-of select="$visible_pages - ($n - $current_page)"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:value-of select="round($visible_pages div 2) - 1"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         
         <!-- Считаем количество выводимых ссылок после текущего элемента -->
         <xsl:variable name="post_count_page">
            <xsl:choose>
               <xsl:when test="0 &gt; $current_page - (round($visible_pages div 2) - 1)">
                  <xsl:value-of select="$visible_pages - $current_page - 1"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:choose>
                     <xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
                        <xsl:value-of select="$visible_pages div 2"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:value-of select="round($visible_pages div 2) - 1"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:variable>
         
         <xsl:if test="$i = 0 and $current_page != 0">
            <span class="ctrl">
               &#8592; Ctrl
            </span>
         </xsl:if>
         
         <xsl:if test="$i >= $n and ($n - 1) > $current_page">
            <span class="ctrl">
               Ctrl &#8594;
            </span>
         </xsl:if>
         
         <xsl:if test="$count_items &gt; $items_on_page and $n &gt; $i">
            
            <!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
            <xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
            
            <!-- Путь для тэга -->
            <xsl:variable name="tag_path">
               <xsl:if test="count(/shop/selected_tags/tag) = 1">tag/<xsl:value-of select="/shop/selected_tags/tag/tag_path_name"/>/</xsl:if>
            </xsl:variable>
            
            <!-- Определяем группу для формирования адреса ссылки -->
            <xsl:variable name="group_link">
               <xsl:choose>
                  <!-- Если группа не корневая (!=0) -->
                  <xsl:when test="$parent_group_id != 0">
                     <xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/>
                  </xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем адрес ссылки -->
            <xsl:variable name="number_link">
               <xsl:choose>
                  <!-- Если не нулевой уровень -->
                  <xsl:when test="$i != 0">page-<xsl:value-of select="$i+1"/>/</xsl:when>
                  <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Передаем фильтр -->
            <xsl:variable name="filter">
               <xsl:choose>
                  <xsl:when test="/shop/apply_filter/node()">?action=apply_filter&amp;producer_id=<xsl:value-of select="/shop/producer_id"/>&amp;saller_id=<xsl:value-of select="/shop/saller_id"/>&amp;price_from=<xsl:value-of select="/shop/price_from"/>&amp;price_to=<xsl:value-of select="/shop/price_to"/>&amp;on_page=<xsl:value-of select="/shop/on_page"/>
                     <xsl:if test="/shop/property_xml/node()">
                        <!-- GET для доп. свойств -->
                        <xsl:value-of select="/shop/property_xml"/>
                     </xsl:if>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Определяем первый символ вопрос или амперсанд -->
            <xsl:variable name="first_symbol">
               <xsl:choose>
                  <xsl:when test="$filter != ''">&amp;</xsl:when>
                  <xsl:otherwise>?</xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Данные для стрелок сортировки -->
            <xsl:variable name="arrows">
               <xsl:choose>
                  <xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
                     <xsl:choose>
                        <!-- Стрелка вверх -->
                        <xsl:when test="/shop/order_direction = 'ASC'">
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=1</xsl:when>
                        <!-- Стрелка вниз -->
                        <xsl:otherwise>
                           <xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&amp;order_direction=2</xsl:otherwise>
                     </xsl:choose>
                  </xsl:when>
                  <xsl:otherwise></xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            
            <!-- Ставим ссылку на страницу-->
            <xsl:if test="$i != $current_page">
               
               <!-- Выводим ссылку на первую страницу -->
               <xsl:if test="$current_page - $pre_count_page &gt; 0 and $i = 0">
                  <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2190;</a>
               </xsl:if>
               
               <xsl:if test="$i &gt;= ($current_page - $pre_count_page) and ($current_page + $post_count_page) &gt;= $i">
                  <!-- Выводим ссылки на видимые страницы -->
                  <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link">
                     <xsl:value-of select="$i + 1"/>
                  </a>
               </xsl:if>
               
               <!-- Выводим ссылку на последнюю страницу -->
               <xsl:if test="$i+1 &gt;= $n and $n &gt; ($current_page + 1 + $post_count_page)">
                  <xsl:choose>
                     <xsl:when test="$n &gt; round($n)">
                        <!-- Выводим ссылку на последнюю страницу -->
                        <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}page-{round($n+1)}/" class="page_link" style="text-decoration: none;">&#x2192;</a>
                     </xsl:when>
                     <xsl:otherwise>
                        <a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">&#x2192;</a>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:if>
            </xsl:if>
            
            <!-- Ссылка на предыдущую страницу для Ctrl + влево -->
            <xsl:if test="$current_page != 0 and $i = $current_page">
               <xsl:variable name="prev_number_link">
                  <xsl:choose>
                     <!-- Если не нулевой уровень -->
                     <xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$i"/>/</xsl:when>
                     <!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
                     <xsl:otherwise></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               
               <a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev"></a>
            </xsl:if>
            
            <!-- Ссылка на следующую страницу для Ctrl + вправо -->
            <xsl:if test="($n - 1) > $current_page and $i = $current_page">
               <a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next"></a>
            </xsl:if>
            
            <!-- Не ставим ссылку на страницу-->
            <xsl:if test="$i = $current_page">
               <span class="current">
                  <xsl:value-of select="$i+1"/>
               </span>
            </xsl:if>
            
            <!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
            <xsl:call-template name="for">
               <xsl:with-param name="i" select="$i + 1"/>
               <xsl:with-param name="items_on_page" select="$items_on_page"/>
               <xsl:with-param name="current_page" select="$current_page"/>
               <xsl:with-param name="count_items" select="$count_items"/>
               <xsl:with-param name="visible_pages" select="$visible_pages"/>
            </xsl:call-template>
         </xsl:if>
      </xsl:template>
      
      <!-- Шаблон выводит рекурсивно ссылки на группы инф. элемента -->
      <xsl:template match="group" mode="goup_path">
         <xsl:param name="parent_id" select="@parent"/>
         
         <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
         <xsl:param name="parent_group_id" select="/shop/@current_group_id"/>
         
         <xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
         
         <xsl:if test="@parent=0">
            <a href="{/shop/path}">
               <xsl:value-of select="/shop/name"/>
            </a>
         </xsl:if>
         
         <span class="path_arrow">&#x2192;</span>
         
         <xsl:choose>
            <xsl:when test="$parent_group_id = @id">
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:when>
            <xsl:otherwise>
               <a href="{/shop/path}{fullpath}">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:template>
   </xsl:stylesheet>


эффекта ноль, доска не отображается((((
#
Re: 2 вопроса по доске объявлений
Элементы для показа вообще есть?

В логах системы(директория /logs/ на сервере) посмотрите наличие сообщений об ошибках XML/XSL.
#
Re: 2 вопроса по доске объявлений
"10.07.2009 09:05:05","#####","<strong>ПРЕДУПРЕЖДЕНИЕ:</strong> DOMDocument::loadXML() [<a href='domdocument.loadxml'>domdocument.loadxml</a>]: Opening and ending tag mismatch: tr line 310 and table in Entity, line: 340 в файле /home/u177336/dvijok.info/www/modules/Xsl/Xsl.class.php (строка 255)

извините за пред.прост.)
#
Re: 2 вопроса по доске объявлений
Ну вот и замечательно, теперь все ясно. Обратите внимание, как у вас в тэмплейте для item-а организуется начало таблицы:
<table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
<tr>

и как организуется ее окончание:
</td>
</table>

Вопрос в том, куда подевался закрывающий
</tr>
?
Добавьте его. Т.е. так:
</tr>
</td>
</table>
#
Re: 2 вопроса по доске объявлений
</tr>
</td>
</table>


возможно,Вы имели ввиду
</td>
</tr>
</table>

?)
#
Re: 2 вопроса по доске объявлений
ой ой ой, какой я невнимательный...прошу прощения...всё верно!)
#
Re: 2 вопроса по доске объявлений
в преведённом Вами коде ошибка (закрытие таблицы)
<!-- Шаблон для товара -->
   <xsl:template match="item">
      <td>

      <table width="97%" border="0" cellpadding="0" cellspacing="0" style="padding: 7px; margin-bottom: 15px; margin-right: 10px; border: 1px dashed red">
         <tr>
            <xsl:if test="small_image != ''">
               <xsl:variable name="td_image_width" select="small_image/@width +10"/>
               <td class="cat_t" style="width:{$td_image_width}px" valign="top" align="center">
                  <!-- Изображение для товара, если есть -->
                  <xsl:if test="small_image/node() and small_image!=''">
                     <a href="{/shop/path}{fullpath}{path}/">
                        <img src="{small_image}" style="border: 1px solid #dadada"/>
                     </a>
                  </xsl:if>
               </td>
            </xsl:if>
            
            <td style="padding-left:12px;" valign="middle">
               <div>
                  <a href="{/shop/path}{fullpath}{path}/" class="cat_title">
                     <span style="font-size: 13pt">
                        <b>
                           <xsl:value-of disable-output-escaping="yes" select="name"/>
                        </b>
                     </span>
                  </a>
               </div>
              
              
               <div style="margin-top:4px;margin-bottom:10px;margin-left:5px;font-size:11px;"></div>
            </td>
            <td width="128" valign="middle">
               <xsl:value-of disable-output-escaping="yes" select="property[@id = 61]/value"/>
         </td>
         </table>
</td>

<!-- Переход на новую строку после каждого 2-го инфоэлемента -->
            <xsl:if test="position() mod 2 = 0">
               <xsl:text disable-output-escaping="yes">
                  &lt;/tr&gt;
                  &lt;tr&gt;
               </xsl:text>
            </xsl:if>
      </xsl:template>

отсюда и проблемы)))
Авторизация