On 14.06.11 17:12, Jason Vas Dias wrote:
> Hi Michael -
> 
> Thanks for responding  - RE:
>> Writer's internal representation of styles is quite different from CSS, so 
>> this is not easily possible.
> 
> Well, leaving the existing HTML filters aside, I'd still like to write
> a filter that does:
>   o for every "style" that is used by a document: write CSS style
> definitions to a header '<style../>' element
>   o emits HTML elements without ANY style attributes (no <FONT> tags
> either) and uses ONLY that CSS

that would probably be possible.
but of course using this approach an exported file
won't necessarily look like the input file.
but perhaps it is good enough.

> Surely the list of of styles used by the document is not too difficult to 
> list ?
> And surely I could re-use the existing HTML filter code that generates
> the elements in a new filter package ?
> I'd find this really useful and interesting to do .   Any tips on what
> to look at to get me started ?

in Writer there are actually 2 HTML filters.
the original HTML filter is in sw/source/filter/html, and uses the
hard-coded formatting tags.

there is also an XHTML filter in filter/source/xslt/odf2xhtml/
this is only an export filter (no import), so in the UI you don't
get it in File->Save..., you have to use File->Export...

i'm not familiar with the XHTML export filter;
i just know it's implemented via XSLT, taking an ODF file as input
(so it should be able to access all the styles).
perhaps it does a better job already of exporting styles.
you should try it out...

-- 
"When C++ is your hammer, everything looks like a thumb."
 -- Steven M. Haflich

-- 
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help

Reply via email to