Say I have this:
<div>
People say <a href="apples.html">apples</a> are nice.
It's true, apples are nice. You go, <b>apples</b>!
<img src="apples.jpg" />
</div>
How would I go about replacing every occurrence of "apples" (with "oranges", for example) within that div (including any tag's element content and plain text) WHILE avoiding replacing such occurrences in the href and src attributes, or any attribute for that matter.
So the end result would be:
<div>
People say <a href="apples.html">oranges</a> are nice.
It's true, oranges are nice. You go, <b>oranges</b>!
<img src="apples.jpg" />
</div>
Should note, while text() would do me a good job in this example, I will be replacing with html elements so it's not particularly helpful in the actual case.
Thanks!