[xsl] Markup a paragraph of text based on keywords

Subject: [xsl] Markup a paragraph of text based on keywords
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 25 Aug 2006 13:57:16 +0100
Given this highly contrived paragraph of text:

<p>words apple words juice, orange words apple</p>

...and a lookup file:

<word>apple</word>
<word>juice, orange</word>

I need to wrap the first occurance of each item in the lookup file
with an anchor:

<p>words <a>apple</a> words <a>juice, orange</a> words apple</p>

The space in the keyword makes this a hard problem... any cunning solutions?

cheers
andrew

Current Thread