A similar style of transformational trees generation
was implemented in sdoc2htm (v2 dated Dec-2000 so
it existed earlier).
   http://olegykj.sourceforge.net/

head  '<title>',y.,'</title>',(css y.),LF
css   '<LINK REL=stylesheet HREF="',(,(,:'../')#~ +/'\'=path y.),'sdoc.css" 
TYPE="text/css">'
body  '<body>',(name y.),(body1 y.),(detail y.),(tail y.),'</body>',LF
body1 '<blockquote>',(abstr y.),(summary y.),'</blockquote>'
name  '<h1><tt>',(toupper y.),'</tt></h1>',LF

So each node is invoked programmatically.
This is probably good to developed some one-off
tools for unattended execution of the same simple task.

But for developing rich content and interaction
intensive web applications, it is more intuitive
to see the tags as they are. This is the prerogative.

A secondary design decision is whether we want
to treat them as chunks of text, or we want to
parse them into a DOM tree for further manipulation,
which requires more costly implementation,
and should warrant basis.

So what are the arguments that text-chunks cannot do, 
or that can be done more easily by tree transformation?

If the argument is about having an abstraction layer,
I'd rather have it on business level in terms of transforming
by business structures directly to HTML, than have
to deal with low-level HTML implementation specifics
on the tree-node basis.

JHP currently supports creating verbs that use the same
<% %> markup and can be used for higher level transformations.
See implementations for database examples in JHP.


--- Raul Miller <[EMAIL PROTECTED]> wrote:

> Note that you can implement tree support in J, if you
> wish.  For example:
> 
> coclass 'htmltree'
> 
> create=:3 :0
>   nms=:;:'parents nodes content classes'
>   (nms)=:_1 0 1 0;(;:'html head title body');2#<4#a:
> )
> 
...
> 
>    page=:''conew 'htmltree'
>    insert__page (<'body');a:;<<'Hi there'
>    insert__page (<'body');(<'div');(<'more text');<<'content'
>    emit__page 0
> <html><head><title></title>
> </head>
> <body>Hi there<div class="content">more text</div>
> </body>
> </html>
> 



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to