This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How can I speed up this Stylesheet


This is a Template that should me display my Navigation-Tree as a Tree with
<ul> and <li> - and I would only display all ancestor and ancestors child´s
from the selected node with $navid. $sd and $ed are the Startdepth and the
Enddepth what should only displayed.

This example works very fine but this execution time is too slow - with
cocoon (without cache) 2s with 30 Treeentrys.

  <xsl:template match="nav">
    <xsl:variable name="nid" select="generate-id()"/>
    <xsl:choose>
      <xsl:when test="count(ancestor::*) &lt; $sd or count(ancestor::*) &gt;
$ed">
        <xsl:apply-templates/>
      </xsl:when>
      <xsl:when
test="boolean(//*[@id=$navid]/ancestor::*[generate-id()=$nid] |
//*[@id=$navid]/ancestor::*/child::*[generate-id()=$nid]) or ../@id=$navid">
        <li>
          <xsl:choose>
            <xsl:when test="@id=$navid">
              <font face="Arial" size="+1"><xsl:value-of
select="@title|@group"/></font>
            </xsl:when>
            <xsl:when test="@title">
              <xsl:call-template name="link">
                <xsl:with-param name="ns" select="."/>
                <xsl:with-param name="text" select="@title"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:when test="@group">
              <b><xsl:value-of select="@group"/></b>
            </xsl:when>
          </xsl:choose>
          <xsl:if test="nav">
            <ul><xsl:apply-templates/></ul>
          </xsl:if>
        </li>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

Would you please help me.

The full XML- and XSL-File can you download from:

http://inter-forum.de/xml/tree2.xml
http://inter-forum.de/xml/tree4.xsl

Thank you

-Conny-


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]