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

Efficiency, use param in key?

Subject: Efficiency, use param in key?
From: Christopher_Dant@xxxxxxxxxxxxxx
Date: Fri, 2 Aug 2002 18:36:44 -0700
intercom plus
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)?

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.

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

Stylesheet:

<xsl:output method="text" encoding="ISO-8859-1" indent="no"/>

<xsl:param name="ele">file_audio</xsl:param>

<xsl:variable name="lc" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="uc" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>

<xsl:key name="fn" match="file_audio" use="@fileref"/>

<xsl:template match="/">
    <xsl:apply-templates select="//file_audio">
        <xsl:sort select="@fileref"/>
    </xsl:apply-templates>
</xsl:template>

<xsl:template match="file_audio[generate-id() = generate-id(key('fn',
@fileref)[1])]">
    <xsl:value-of select="translate(@fileref, $uc, $lc)"/>
    <xsl:text disable-output-escaping="yes">&#xD;&#xA;</xsl:text>
</xsl:template>

Excerpts of sample input:

<frame id="01" type="a" parms="a">
<txt_scr lang="ENG"/>
<txt_aud>Click on a button in front of the module you wish to begin
and...</txt_aud>
<file_audio fileref="coursemenu.mp3"/>
</frame>
.
.
.
<frame id="01">
<txt_scr lang="ENG">Welcome to the Intercom Plus training!</txt_scr>
<txt_avi>{Zelda} Hi, welcome to the Intercom Plus Training! I am Zelda
Morales...</txt_avi>
<file_avi start_frame="1" end_frame="359" fileref="__A_.0010.001.avi" />
</frame>
.
.
.

TIA
Chris

Christopher Dant
Technology Director
Jack Morton Worldwide
Christopher_Dant@xxxxxxxxxxxxxx



 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.