I guess I cheat... I use tidy to convert from html to xhtml and gather up the style info into one place in the <header>; then I delete all that and change <p class=... > into <p>. Then I write a stylesheet.css that does what I want.
I know that loses all the classes, but it works fairly well for simple book conversions.
But, yes, I have been thinking about a parser that does what you want, at least items 2 & 3. I'll get to it eventually, unless someone else does it first.
|