durusmail: quixote-users: DOMish view of HTML as it's being rendered
ZODB FileStorage problem
2002-02-27
2002-02-28
2002-02-28
2002-03-01
DOMish view of HTML as it's being rendered
2002-02-28
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
DOMish view of HTML as it's being rendered
Jeff Bellegarde
2002-03-01
Not so bizarre. I've done this kind of thing a number of times. It can be
usefull in some situations.

However, the DOM-like approach is probably overkill. Usually I've been able
to break up the output into seperate strings and build up each string
seperatly and concatenate them together at the end.

start = "yadda yadda yadda"
middle = ""
#Add stuff to middle, recording the needed data for the head.
middle.append("stuff")
data = "something"
middle.append("more stuff")

#put it all together
start+data+middle

I haven't actually done much with Quixote yet but I've done it a lot in
servlets, it should be mostly the same.

If I need something more complicated I'll do all the calculation first and
then turn it into HTML.

data = "something"
""+data+"..."

The main issue is just seperating between calculating the result and
formating it. While you are allowed to format as you go there is no
requirement that you do so.


On Thursday 28 February 2002 08:52 pm, David Ascher wrote:
> Here's another question that's straight on for Quixote.
>
> I've found that at times I need to do a fair bit of reorganizing of my
> code in order to, e.g., get the right things in the , while I'm
> actually deep in the body of the .  Given the very "sequential"
> nature of "HTML accretion" in Quixote, that can be a little tricky.
>
> Has anyone else longed for a DOM-like approach at times, where one
> could, as an _alternative_ to just returning strings, do something like:
>
>    response.head.append('bit of html')
>
> or
>
>
> response.getElement('table1').getChild('header_row').insertChild('Perce
>ntages')
>
> ?
>
> I realize that there are lots of technical challenges involved in doing
> DOMish things on an as-yet ill-formed document.  At this point I'm just
> trying to figure out if my wishes seem bizarre to the rest of you.
>
> --david
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://www.mems-exchange.org/mailman/listinfo/quixote-users

--
-- Jeff Bellegarde


reply