From: Tobias Reif Date: 2001-09-06T00:25:02+09:00 Subject: [ruby-talk:20931] Re: Minor cgi.rb question Niklas Frykholm wrote: > On Wed, Sep 05, 2001 at 07:07:45PM +0900, Tobias Reif wrote: > [Tobias Reif] > >>Absolutely. As I suggested, options for the current version of HTML >>should be provided: >>XHTML1 strict + CSS1, (works well in IE5 and NN6) >>XHTML1 transitional + CSS1, (for table stuff in non-NN6ers) >>XHTML1 strict + CSS2, (~NN6+) >> >>and possibly other options for HTML4 loose, HTML3, ... >> > > I don't suppose you mean that you should be able to do something like: > > font('brownish', {:color => '0xcccc00'}) > > and then it would turn into a "" tag if the user had selected > to generate HTML3 and "" if she had selected to generate CSS? > If you do, I think it is too ambitious... it would essentially mean that we > would have to define our own markup language. I'd like an API for generating XHTML, another for CSS, another for HTML. Not the same commands plus a flag for the version; completely seperate APIs instead. > I think the library should only provide "raw" tag-generating functions and > not care about whether the document is well-formed or not according to some > DTD. HTML Validation is useful, but it should be in a module of its own. > (So should CSS generation also, I think. And JavaScript generation --- if > anyone wants that.) An XHTML lib could provide CSS and JavaScript writers in classes, modules, ... Those Java XHTML writers, which often are specialized children of XML serializers in the same lib must have solved some problems in a good way; check http://xml.apache.org/xerces-j/apiDocs/org/apache/xml/serialize/HTMLSerializer.html#startDocument(java.lang.String) http://xmlconf.sourceforge.net/java/apidoc/gnu/xml/util/XMLWriter.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes) etc. Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/