On 1/16/06, David Bernard <[EMAIL PROTECTED]> wrote:
>
> My PluginTemplate works in the other way, produce Elements (nativ
> format) in transform and flatten the tree of Element to string into
> render.
>
> My question is about what must be return by engine.transform() and
> widget.insert()
>
> Both are important because, I've got widget that doesn't use engine to
> provide the insert method.
I see. It's always interesting to hear of the unexpected things people
think of :)
You're right that the transform documentation is just plain wrong.
In [2]:t = kid.Template("<html><p>Data</p></html>")
In [3]:t.transform()
Out[3]:<generator object at 0x5dc670>
In [4]:list(t.transform())
Out[4]:
[(1, <Element u'html' at 0x5c0d10>),
(1, <Element u'p' at 0x5c0da0>),
(3, u'Data'),
(2, <Element u'p' at 0x5c0da0>),
(2, <Element u'html' at 0x5c0d10>)]
David Stanek probably knows offhand what the first part of those tuples are.
Kevin
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com