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

Re: Merging 2 XML's in to 1 output XML (Performance I

Subject: Re: Merging 2 XML's in to 1 output XML (Performance Issue)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 12 Oct 2005 16:15:42 +0100
Re:  Merging 2 XML's in to 1 output XML (Performance  I
> say for each record in InputXSL1 with Key match in InputXSL2 get 
                                       ^^^^

The answer is (probably) in your description. You are repeatedly
traversing the other tree to find a st:VehicleTT with the same DFFileId
as the current node. xsl:key is designed to optimise such access 9often
by orders of magnitute).

<xsl:template match="//st:VehicleTT">

You don't want the // there (all it does is change the priority, nit the
nodes matched)

I think you just want
<xsl:stylesheet version="1.0">

<xsl:output method="xml" indent="yes" />

<xsl:variable name="aggregator" select="document('InputXML2.xml')" />

<xsl:template match="/">
	<st:VehicleTDoc>
  		<xsl:apply-templates/>
	</st:VehicleTDoc>
</xsl:template>

<xsl:key name="v" match="st:VehicleTT" use="concat(xdd:DFFileId,':',xdd:RSNo)"/>

<xsl:template match="st:VehicleTT">
    <st:VehicleTT>
	    <xsl:copy-of select="*"/>
<xsl:variable name="key" select="concat(xdd:DFFileId,':',xdd:RSNo)"/>
<xsl:for-each select="$aggregator">
 <xsl:copy-of select="key('v',$key)/xdd:SName"/>
</xsl:for-each
</xsl:template>
	
</xsl:stylesheet>


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.