[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Optimization using keys

Subject: Re: Optimization using keys
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Thu, 17 Feb 2005 07:28:36 -0800
Re:  Optimization using keys
Antsnio Mota wrote:
Yes, it is global. My intention even was to do

<xsl:template match="$snode">

or

<xsl:template match="(//Menu)[number($pos)]">

but no can do, i'm in 1.0 (i recall it can be done in 2.0).

If i could do this i expected a speed increase, because i can just
copy evrithing without checking wath it is and just treat the one
selected...

Now i have to check for all Menu nodes if it's the one i want, and
there are currently 317 and counting...

I can't seem to think of anything else to improve this...



Hi,


I haven't followed the whole thread (was on a little vacation...), but it seems like you want something like the following. It looks like you have your current focused node in a variable, so you can apply-templates on it. When you match it you can apply-templates on its parent in a mode to get a view of the current menu state.

...
<div class="menu">
  <xsl:apply-templates select="$snode" mode="start-menu"/>
</div>
...

<xsl:template match="*" mode="start-menu">
  <xsl:apply-templates select="parent::*" mode="menu"/>
</xsl:template>

<xsl:template match="*" mode="menu">
  <xsl:apply-templates mode="menu"/>
</xsl:template>

Then use the templates I provided in the beginning of your thread (if I remember correctly) on dealing with hierarchical menus.

best,
-Rob

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.