[Home] [By Thread] [By Date] [Recent Entries]
Hi Jeff,
Here's one way to do it, but without keys. Though it might be that the lookup loop is optimized by the processor, at least it will be faster than your //text(). Either $source, $lookup or both will be your external documents for source and lookup table. As long as they remain global variables or parameters, you can use them in the match-clause of the xsl:template, giving the processor all opportunity to use the pull model (or was it push model? I keep mixing them up... see thread "is XSLT dead"). <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output indent="yes" /> <xsl:variable name="lookup"> <entry>text 1</entry> <entry>text 2</entry> </xsl:variable> <xsl:variable name="source"> <head>some text 1 some text some text some text</head> <head>nothing here some text some text some text</head> <head>some text 2 some text some text some text</head> </xsl:variable> <xsl:template match="/" name="main"> <xsl:apply-templates select="$source/head" /> </xsl:template> <xsl:template match="head[not((for $i in $lookup/entry return matches(., $i))[.])]"> <found this="{.}" /> </xsl:template> <xsl:template match="*" /> </xsl:stylesheet> Jeff Sese wrote: Hi,
|

Cart



