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

Re: Optimizing a XSLT

Subject: Re: Optimizing a XSLT
From: "Mike Haarman" <mhaarman@xxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Apr 2003 13:37:54 -0500
xslt populate attribute
Eric,

You seem to be solely using string manipulation to create elements and
attributes in your output.  I wonder if it would be quicker to use the features
of XSL provided to build and populate element and attribute nodes:

>  <xsl:template name="PricePointProcess">
>   <xsl:text disable-output-escaping="yes">&lt;PricePoint MW="</xsl:text>
>    <xsl:value-of select="mw"/>
>   <xsl:text disable-output-escaping="yes">" price="</xsl:text>
>    <xsl:value-of select="price"/>
>   <xsl:text disable-output-escaping="yes">"/&gt;</xsl:text>
>  </xsl:template>

<xsl:template name="PricePointProcess">
<xsl:element name="PricePoint">
<xsl:attribute name="MW">
<xsl:value-of select="mw"/>
</xsl:attribute>
<xsl:attribute name="price">
<xsl:value-of select="price"/>
</xsl:attribute>
</xsl:element>
</xsl:template>

I daresay that this will be rather quicker.  Particularly if you are using a
processor implemented in Java this will be doing less mucking with strings and
more building your output tree for the same amount of processing.  Untested.

hth,

Mike


 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.