gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Jack" <>
Subject Re: Generating HTML (was Gump Threashing/Spinning)
Date Thu, 25 Mar 2004 23:00:05 GMT
> > First, I like the dynamic 'tree of nodes' based approach to writing
> > HTML/XML, rather than template
> I like merging the concepts. Once you've built the tree, flatten the
> part of it that will make up the page, and feed that to the template
> engine. Even if you don't use a template engine, seperate the flattening
> and splitting from the transformation step.

I am game to explore this. HTML or XML (xdoc) output ought be the same code,
just with different templates, so we can  have 'pure Python generating HTML'
and/or 'forrest on xdocs' without us having to compromise, right?

> This is different from stuff like anakia, where the template walks the
> tree directly (bad).

I think this is the key.  I'd really like to find a good way to go from a
tree of objects (not DOM, our models and context, etc.) to variables for
templates, or whatever. I don't want this to be kludgy, and feel that
cheetah/Python likely have some sort of slick solution.

BTW: I can see the need to use includes, and I can see 'if' directives, but
maybe we'd still want to use bits of templates glued together to get re-use.
I think it depends upon the tree to tempalte choice we make...

> > Second, I didn't realize that Python DOM had nice serialization
> > Maybe I should've used that from the start.
> No idea what you're talking about :D

The Python DOM tree will serialize to an XML stream (unlike old DOMs I'm
used to). I wrote some stuff I should never have in Python. Hey, we are here
to learn, right?

> > Now Gump generates it's xdocs using an object tree structure. Watching
> > python memory grow from 20M (after loading all XML) to 136M (during
> > generating these pages) it has some sort of leak (actual or effective)
> ouch! Maybe it would pay off to use pipelining (you know, SAX, stuff)
> instead of DOM to generate the object tree.

I wonder if it is some sort of circular dependency (amonst the objects) so
when I destroy a tree (by pointing the variable to a new one) I wonder if it
truely gets destroyed. I know the DOM has an unlink() method for some good
reason, along these lines.

There is so much thrown up into memory, more with translations to try to
cope with character sets (and binary junk) and such. I no longer believe
that any is being thrown away when I mean it to be...

> > Fixing this area is clearly important, and I'd appreciate all
> No insights here, just babbling along ;)

Better than my just listening to the babbling in my head. ;-)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message