0

The question is not really about parsing the HTML, but rather parsing the HTML and adding elements to the DOM according to the HTML tags. For example - I want to be able to take an HTML page, add attribute to the HTML tags - such as "class='replace'", put some PHP/ASPNET code in the page (make an ASPX page with ASPNET or put some include with PHP) and make them parse the page every time it is accessed and manipulate the DOM of the tags marked as 'class="replace". For example if I have < div class='replace'>< /div>, after I run the script I'll get something like < div class='replace'>This is a new text< /div>

Thanks, Roman

  • a parsing question but not really about parsing? – Rubens Farias Jan 27 '10 at 12:04
  • It is a little bit about parsing... you have to parse the HTML after all :) –  Jan 27 '10 at 12:06
  • Okay, parsing or not parsing isn't the issue... what is the question? I don't see one, just a little ramble about what you want to do. In ASP.NET I think the thing you want to read up about is 'Controls' – Lazarus Jan 27 '10 at 12:17

2 Answers2

0

HTML parser for PHP, and one for .NET.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

See

in PHP, how to remove specific class from html tag?

For complex and simple solutions in PHP using DOM parser object or preg_replace.

C.

Community
  • 1
  • 1
symcbean
  • 47,736
  • 6
  • 59
  • 94