On Monday, March 11, 2002, at 01:53 PM, JavaJosh wrote:

> I would like to precompile my HTML files that have style sheets. That
> is, I would like to generate (perhaps on the fly) basic HTML 
> markup from
> the CSS. For example, I want to turn:
>
> P.main {font-family : sans-serif; font-size : 12pt}
> ...
> <p class="main">This is a paragraph</p>
>
> into
>
> <p> <font face="Arial" size="7"> This is a paragraph </font></p>
>
> I would prefer to avoid such behavior, as many CSS attributes cannot be
> mapped to basic (HTML32) tags. However, I can see where this would be
> useful for users of older browsers that don't understand CSS.
>
> (A secondary consideration is the protection of CSS content. This isn't
> something that concerns *me* but I can see where it might be an issue.)
>
> So is there a way to do this, if not with a Tomcat directive, with a
> special servlet or library?

I'm sure there would be a way to do this, but it seems like a 
*lot* of work for questionable payoff (and sounds slow). Do your 
browser stats really indicate that you need to put so much 
effort toward making HTML 3.2 code? In our site which is 
non-technical (a weather site) we only use CSS for text 
formatting and various colorings... we have a very wide range of 
users and I do not get complaints. Virtually all used browsers 
can handle CSS for fonts... CSS-P gets much more glitchy.

Personally, if I *had* to do this I would consider using XML and 
apply XSL dynamically based on browser sniffing. But in the end 
I would have a very hard time justifying the effort.

Use CSS to define elements, and use few classes and spans and 
you should be able to be quite compatible.

JTOTTOMH, you could probably write (fairly complex) taglibs for 
this... blech.

Ken Martin


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to