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

Re: selecting specific elements from a second file

Subject: Re: selecting specific elements from a second file
From: "Mark Wilson mark@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 17 Dec 2016 16:13:13 -0000
Re:  selecting specific elements from a second file
Thanks
Mark

On 12/17/2016 9:05 AM, Graydon graydon@xxxxxxxxx wrote:
On Sat, Dec 17, 2016 at 03:37:38PM -0000, Mark Wilson mark@xxxxxxxxxxxx scripsit:
Thank you, Martin,
Made one small change:
<xsl:template match="Stamp">
         <xsl:copy>
             <xsl:apply-templates select="@*, node(), key('flaws',
CatNumbers/@pofis-number, doc('../work/flaws3.xml'))/node()"/>
         </xsl:copy>
     </xsl:template>
The optimizer in whatever processor you are using may or may not save
you from this by realizing it should cache the results of the doc()
function, but defining a global variable (one a child of the
xsl:stylesheet element)

<xsl:variable name="flaws3" as="document-node()"
     select="doc('../work/flaws3.xml')"/>

and then doing the apply-templates as

<xsl:apply-templates select="@*, node(),
     key('flaws', CatNumbers/@pofis-number, $flaws3)/node()"/>

is likely to get you better performance.

-- Graydon

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.