Subject: XML text search & replace
From: a kusa <akusa8@xxxxxxxxx>
Date: Wed, 23 Mar 2011 08:50:00 -0500
|
Hello
There is a requirement to search for a particular pattern in XML
documents and replace them by reading another XML file and copying
over the replacement text correcpinding to the original text. I have
been trying to use <xsl:analyze-string> in xslt 2.0. but I am not sure
how to read another XML file using this tag.
As an example, if I have some text tagged within <para> tags :
<para> this is a simple text</para>
I have an external xml file of the form:
<matchtext>simple</matchtext>
<replacetext>hard</replacetext>
In my <xsl:matching-substring>, can I use doc() to read the external
XML file and replace the text?
Any ideas, suggestions or a better approach is appreciated.
Thanks in advance for your help.
|