I've to retrieve all the html that will be rendered by whatever web part zone.

The scope is looking for some words in the web part zone, match them with those contained in a repository and replace with different html.


You will probably need to override any controls that display text to avoid this issue. As this would be a lot of work and difficult/impossible to get right, try an HTTP Module.

HTTP Modules work with the output of a page once SharePoint has already generated it but before it is sent down the wire to the user. Your module would intercept and replace any matching HTML with what you require. There is an example here.

Alex Angas
+1  A: 

The simplest / quickest solution (to code at any rate) is to do this client side in JavaScript.

Use jQuery or similar to enable you to get at the text and Reg Exp in JS to pattern-match and replace text. There are any number of caveats to this solution, but it is a very light-weight way to go and is very quick to develop (assuming some familiarity with JavaScript etc).

I've used this technique to generate links in SharePoint content or to replace SharePoint text for example - it can be added to a page if required simply by using a CEWP.

Yes another good option provided there is no sensitive data (i.e. if JavaScript is disabled and it can't run)
Alex Angas