|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Lookup efficiency in XALAN?
J,
At 04:45 PM 11/20/2003, you wrote: I have to do some validation in my xsl. The first thing you should definitely do is collect the lookup ids into a variable, as in <xsl:variable name="keys" select="document('../master/ids-master.xml')/ids/id/@key"/> Then you can test your local ids against the keys in the variable, without parsing your lookup file every time (which it sounds like your processor might be doing): <xsl:when test="not($id = $keys])"> Try that and see if it helps. If Xalan is already optimizing the document() lookup and parse, you may get no gain from this technique -- but there's no way it could hurt. XSLT keys could also help, but since your keys are in a separate document you'd have to switch contexts to use the XSLT key function, like so: <xsl:key name="keys-by-id" match="id" use="@key"/> <xsl:variable name="keyfile" select="document('../master/ids-master.xml')"/> ... and then <xsl:for-each select="$keyfile">
<xsl:when test="not(key('keys-by-id', $id))">...</xsl:when>
</xsl:for-each>but whether this helps also will depend on your processor and what kind of smarts it has inside. Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








