Subject: [xsl] Re: Efficient dictionary lookup From: Martin Holmes <mholmes@xxxxxxx> Date: Thu, 22 Mar 2012 17:49:20 -0700 |
[SNIP]On 22/03/2012 21:39, Martin Holmes wrote: > HI all, > > As part of a small pilot project, I'm implementing a set of spelling > normalization rules applied through XSLT 2.0 using Saxon 9. One > operation that happens extremely frequently is a dictionary lookup;
sounds like you want to use a key then the processor will almost certainly create an efficient lookup index.
If your dictionary is in a file say dict.xml <words> <word>one</word> <word>hello</word> </words>
then
<xsl:key name="w" match="word" use="."/>
declares the index and
key('w',$word,doc('dict.xml'))
will return the word if it is in the dictionary.
Cheers, Martin
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Efficient dictionary look, David Carlisle | Thread | Re: [xsl] Re: Efficient dictionary , David Carlisle |
Re: [xsl] Problem with a key, Russell Urquhart | Date | Re: [xsl] loop without switching co, Michael Kay |
Month |