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

Re: Efficiency, use param in key?

Subject: Re: Efficiency, use param in key?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 2 Aug 2002 22:58:38 -0700 (PDT)
 Re: Efficiency
--- Christopher_Dant at jackmorton dot com wrote:

> On working a stylesheet that processes a multimedia-course storyboard
> and
> returns text, CRLF-delimited, sorted, lowercase, no-duplicates
> filenames I
> have several questions:
> 
> 1. is there anything I should do to improve it (make it more
> efficient)?

Not too much:

1. Avoid expressions like "//file_audio" whenever possible. Probably
this is just "file_audio", or "$someFixedPath/file_audio" ?

2.    <xsl:text disable-output-escaping="yes">&#xD;&#xA;</xsl:text>
                ^^^^^^^^^^

This seems strange to me.

> 
> 2. is it possible to use the param "ele" in key, apply-templates and
> template? This would make it possible for a single stylesheet to look
> for
> file_audio, file_video or file_graphic tags.

The "match" attribute of xsl:key and xsl:template cannot contain
variable references -- this is said in order to prevent circular
definitions, as global variables can be defined using the key()
function or xsl:apply-templates. Due to the same reason the "use"
attribute of xsl:key cannot contain variable references.

Variable references can be used in the value of the "select" attribute
of xsl:apply-templates.


> 
> 3. Or perhaps I should actually ask, is there a way to rework my
> approach
> so I can parameterize it?

One way to parameterise the usage of keys is to pass their ***name***
as parameter to a template.


Hope this helped.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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


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.