I don’t think this makes sense. ODF and HTML don’t address the same domains. IMHO, HTML has a much wider scope because it is not centered exclusively on text rendering.
Also, class="…"
doesn’t designate a “style”. It can be used for many other purposes. Think of all the various frameworks available today. They heavily use <div class=some_id>
to designate groups of locations. This is useful for positioning blocks around the screen.
The CSS structure is not the same as ODF. in HTML, you can write <span class="style1 style2>
to request application of two CSS decorations (after resolving possible conflicts through CSS selectors), whereas in ODF you can have a single character style only.
I understand your purpose of preserving the semantic markup present in the HTML file. Perhaps the solution would be a transformation of your HTML into ODF XML. This may be feasible with rewriting tools such as XSLT. Be prepared to add the necessary ODF preamble to obtain a usable ODF file. You can afterwards create the style definitions manually in Writer.