From: Eero Saynatkari Date: 2005-12-16T14:48:20+09:00 Subject: Re: adding any to a rexml doc (bump) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2005.12.16 14:38, ara.t.howard@noaa.gov wrote: > On Fri, 16 Dec 2005, Eero Saynatkari wrote: > > > On 2005.12.16 03:57, ara.t.howard@noaa.gov wrote: > >> > >> > >> > >> > >> is there know way to do this > >> > >> require "rexml/document" > >> > >> include REXML > >> > >> Text::new " i < know & what i'm doing " > >> > >> it seems not... > > > > Perhaps it is time to try Builder or htree? :) > > i can't stand the builder api. htree is good - but i'm not looking for a > template engine - does it provide hooks to generate html without using > templates. the code i'm working on attm can do things like this: > > [ahoward@localhost xx-0.0.0]$ cat a.rb > require "xx" > class Table < ::Array > include XX::XHTML > > def to_xhtml > xhtml__{ > > html__{ > head__{ title__{ "table demo" } } > > h1__(:style => :sweet){ "this is a table " } > > h__{ " > table__(:width => 42, :height => 42){ > each{|row| tr__{ row.each{|cell| td__ cell } } } > } > } > > }.pretty > end > end > > puts Table[ %w( 0 1 2 ), %w( a b c ) ].to_xhtml > > > [ahoward@localhost xx-0.0.0]$ ruby -I./lib a.rb > > > > table demo > >

this is a table

> > 0 > 1 > 2 > > > a > b > c > > > > > > coming soon to a store near you ;-) Very nice! (Well, sans underscores:) Will you make libxml2[1] an alternative backend? It is quite a bit faster, which may or may not be important to people. > regards. > > -a E [1] http://xml-tools.rubyforge.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDol3YxvA1l6h+MUMRApOaAJwNvEboVkzD+rSI6XPu9wQNWXdRqgCghsH5 fk5nmlI2wRb2dOhff/o8lR8= =uORR -----END PGP SIGNATURE-----