Меню

Модератор
#
Re: Меню
neket2,
Во первых этот шаблон не для UTF-8 версии, поэтому в шаблоне вместо windows-1251 необходимо использовать utf-8
Далее необходимо предоставлять тексты ошибок для анализа.
#
Re: Меню

Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: XML declaration allowed only at the start of the document in Entity, line: 2 в файле /home/kompros/public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: StartTag: invalid element name in Entity, line: 4 в файле /home/kompros/public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Entity 'nbsp' not defined in Entity, line: 18 в файле /home/kompros/public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Entity 'nbsp' not defined in Entity, line: 18 в файле /home/kompros/public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Entity 'nbsp' not defined in Entity, line: 20 в файле /home/kompros/public_html/modules/Xsl/Xsl.class.php (строка 267)


примерно вот так
#
Re: Меню
Убрал из файла все
 


Использую следующий XSL-файл:

<?xml version="1.0" encoding="utf-8"?>
<!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="no" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml" />
   <xsl:template match="/document">
      <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-top: 2px; margin-left: 0px;">
         <tr>
            <xsl:apply-templates select="structure[show=1]"/>
         </tr>
      </table>
   </xsl:template>
   <xsl:template match="structure">
      <xsl:param name="posit" select="1" />
      <xsl:variable name="current_structure_id" select="/document/structure/current_structure_id"/>
      <xsl:if test="show_link = 1">
         <!-- Определяем адрес ссылки -->
         <xsl:variable name="link"><xsl:choose>
               <!-- Если внешняя ссылка -->
               <xsl:when test="is_external_link=1"><xsl:value-of disable-output-escaping="yes" select="external_link"/></xsl:when>
               <!-- Иначе если внутренняя ссылка -->
               <xsl:otherwise><xsl:value-of disable-output-escaping="yes" select="link"/></xsl:otherwise>
         </xsl:choose></xsl:variable>
         <!-- Определяем стиль вывода ссылки -->
         <xsl:variable name="link_style"><xsl:choose>
               <!-- Выделяем текущую страницу жирным (если это текущая
               страница, либо у нее есть ребенок с ID, равным текущей) -->
               <xsl:when test="current_structure_id=@id or count(.//structure[@id=$current_structure_id])=1">font-weight: bold</xsl:when>
               <!-- Иначе обычный вывод с пустым стилем -->
               <xsl:otherwise></xsl:otherwise>
         </xsl:choose></xsl:variable>
         <xsl:choose>
            <xsl:when test="level=0">
               <xsl:choose>
                  <xsl:when test="count(structure[show=1]) > 0">
                     <td valign="top" OnMouseOver="JavaScript:SlideLayer('id_{@id}');" OnMouseOut="JavaScript:SlideLayerHide('id_{@id}');">
                        <div>
                           <a href="{$link}" class="menu_center"><xsl:value-of select="name"/></a>
                        </div>
                        <div style="display: none; z-index: 10; padding-right: 0; margin-top: 1px; margin-left: 0px; margin-right: 0px;" id="id_{@id}">
                           <table border="0" cellpadding="0" cellspacing="0">
                              <xsl:variable name="posit_var" select="position()"/>
                              <xsl:apply-templates select="structure[show=1]">
                                 <xsl:with-param name="posit" select="$posit_var"/>
                              </xsl:apply-templates>
                           </table>
                        </div>
                     </td>
                  </xsl:when>
                  <xsl:otherwise>
                     <tdvalign="top" align="center">
                        <a href="{$link}" class="menu_center"><xsl:value-of select="name"/></a>
                     </td>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:when>
            <xsl:otherwise>
               <td><a href="{$link}" class="menu_link_no_bold"><xsl:value-of select="name"/></a>
               </td>
            </tr>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:if>
</xsl:template>
</xsl:stylesheet>

Выдаётся следующая ошибка

Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: error parsing attribute name in Entity, line: 50 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: attributes construct error in Entity, line: 50 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Couldn't find end of Start Tag tdvalign line 50 in Entity, line: 50 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: otherwise line 49 and td in Entity, line: 52 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: choose line 33 and otherwise in Entity, line: 53 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: when line 32 and choose in Entity, line: 54 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: choose line 31 and when in Entity, line: 55 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: otherwise line 56 and tr in Entity, line: 59 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: if line 15 and otherwise in Entity, line: 60 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: template line 12 and choose in Entity, line: 61 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: stylesheet line 3 and if in Entity, line: 62 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Предупреждение: DOMDocument::loadXML() [domdocument.loadxml]: Extra content at the end of the document in Entity, line: 63 в файле /public_html/modules/Xsl/Xsl.class.php (строка 267)
Авторизация