Hi,
I have this function (thanks to sir M. Kay) that search and replaces all
occurrences of a sequence of search string with its corresponding
replacement string.
<xsl:function name="ati:replace-all">
<xsl:param name="input" as="xs:string"/>
<xsl:param name="words-to-replace" as="xs:string*"/>
<xsl:param name="replacement" as="xs:string*"/>
<xsl:sequence select="if (exists($words-to-replace)) then
ati:replace-all(replace($input, $words-to-replace[1],
$replacement[1]),remove($words-to-replace,1),remove($replacement,1))
else $input"/>
</xsl:function>
Can this be modified so that I can place the search string inside an
element and the replacement string inside an attribute?
I have this as a sample:
<p>This is supposed to be my input string with search1, search2, and
search3.</p>
I want this to be:
<p>This is supposed to be my input string with <replacement
value="replacement1">search1</replacement>, <replacement
value="replacement2">search2</replacement>, and <replacement
value="replacement3">search3</replacement>.</p>
Thanks,
Jeff
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--