Subject: How can I speed up this Stylesheet From: Conny Kreyßel <Conny.Kreyssel@xxxxxxxxxxxxxx> Date: Fri, 4 Aug 2000 09:14:14 +0200 |
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::*) < $sd or count(ancestor::*) > $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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: problem using Xalan from within, Sia Rahimi | Thread | RE: How can I speed up this Stylesh, Kay Michael |
RE: Complex Path Checking, Heiner de Wendt | Date | Re: Image in XSL?, Betty L. Harvey |
Month |