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

Re: XSL:Copy w/ Processing Optimization Suggestions

Subject: Re: XSL:Copy w/ Processing Optimization Suggestions
From: martin@xxxxxxxx
Date: Thu, 13 Mar 2003 01:49:02 +0000 (GMT)
dana cordes

On Wed, 12 Mar 2003, DANA CORDES wrote:

> ...  I'm looking for any pointers on a better/faster/more
> effecient way of doing this.

i'll give it a go -

<xsl:template match="Part[contains(@DisplayValue, 'BM5125')]|*">
<xsl:element name="Part">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="*">
  <xsl:sort order="ascending" select="@DisplayValue" />
</xsl:apply-templates>
<!-- these come last anyhow, right? -->
<xsl:apply-templates select="processing-instruction()|text()"/>
</xsl:element>
</xsl:template>

<xsl:template match="Part"/> <!-- don't want these -->

<xsl:template match="processing-instruction()|text()|@*">
<xsl:copy-of select="."/>
</xsl:template>


firstly you shouldn't have to sort non-element nodes since the sort
criteria is an attribute. and you can usually get clearer stylesheets
by trying to make more specific templates.

hth,

/m

Martin Klang
http://www.o-xml.org - the object-oriented XML programming language



 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.