M
maheshvd
Hi Group,
I've a HTML document with all sorts of HTML tags. I nned to provide
search and replace feature for text in the HTML documents. User can
enter any phrase to search and any phrase to replace it with. While
searching, I strip all HMTL tags from the HTML document and search.
User can select the document(s) s/he wants to replace the desired
text.
While replacing, I've issue. How do I replace the string with the new
one?
e.g.
The HTML document may contain:
<li>This is a test document</li> All the <b>articles</b> here are
written for general public. <strong>Tip: <strong>If you do not find
desired articles, please mail <SPAN id="test" style="FONT-WEIGHT:
bold; COLOR: #ff0000">[email protected]</SPAN >
User may want to find
"All the articles here"
and replace with
"all the documents here".
The resultant document could be
<li>This is a test document</li> All the documents here are written
for general public. <strong>Tip: <strong>If you do not find desired
articles, please mail <SPAN id="test" style="FONT-WEIGHT: bold; COLOR:
#ff0000">[email protected]</SPAN >
So while replacing the string, can I somehow ignore the HTML tags and
achieve replacement? Rest of the HTML tags must be retained in the
HTML doc.
Any thoughts will be appreciated.
Regards,
dev
I've a HTML document with all sorts of HTML tags. I nned to provide
search and replace feature for text in the HTML documents. User can
enter any phrase to search and any phrase to replace it with. While
searching, I strip all HMTL tags from the HTML document and search.
User can select the document(s) s/he wants to replace the desired
text.
While replacing, I've issue. How do I replace the string with the new
one?
e.g.
The HTML document may contain:
<li>This is a test document</li> All the <b>articles</b> here are
written for general public. <strong>Tip: <strong>If you do not find
desired articles, please mail <SPAN id="test" style="FONT-WEIGHT:
bold; COLOR: #ff0000">[email protected]</SPAN >
User may want to find
"All the articles here"
and replace with
"all the documents here".
The resultant document could be
<li>This is a test document</li> All the documents here are written
for general public. <strong>Tip: <strong>If you do not find desired
articles, please mail <SPAN id="test" style="FONT-WEIGHT: bold; COLOR:
#ff0000">[email protected]</SPAN >
So while replacing the string, can I somehow ignore the HTML tags and
achieve replacement? Rest of the HTML tags must be retained in the
HTML doc.
Any thoughts will be appreciated.
Regards,
dev