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

RE: Lookup efficiency in XALAN?

Subject: RE: Lookup efficiency in XALAN?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 21 Nov 2003 08:05:28 -0000
xalan out of memory
> I have to do some validation in my xsl. 
> 
> I'm doing the following type statement 20,000 times, and the 
> lookup file is around 50,000  lines of  id's <id key="XXYYZZJ"/>.
> 
> <xsl:when 
> test="not(document('../master/ids-master.xml')/ids/id[@key=$id])">
> 
> It works for a while, then dies with an out of memory error, 
> and it sure is slow!
> 
> 
> Any ideas for a faster/reliable search?
> 

Anything like this should be vastly improved by using keys. As Wendell
explained, it's a bit clumsy in XSLT 1.0 because you have to change the
context document to use a key; you may have to write something like:

<xsl:variable name="test">
<xsl:for-each select="document('../master/ids-master.xml')">
  <xsl:if test="key('k', $id)">true</xsl:if>
</xsl:for-each>
</xsl:variable>

<xsl:when test="$test='true'">

Having said that, I'm a little surprised at the "out of memory" error.
What you're doing seems expensive in time, but not in memory.

Michael Kay


 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.