I'm wondering if KID match filters could be used as XML transformations.  Here is my scenario:

I have a website with an index file which in turn extends a layout file containing standard headers and footers for my entire site:
index.kid -- This is a regular .kid xml file that py:extends _layout.kid in order to get standard headers and footers.
_layout.kid -- This contains a py:match filter which adds my standard headers and footers.

That's all working fine.  But now I have another situation.  I also have some python code that generates some XHTML on the fly.  I'd like to "apply" my layout filter to these snippets of generated XHTML so that the output has my standard headers and footers, with the bits of XHTML inside the <body>s.  Now obviously I could put in <html py:extends="_layout.kid"> in my bits of xhtml, but it seems like it would be better to load up my layout.kid template once, and then "run it on", or "apply it to" my bits of xhtml to generate finished pages.

In other words, the standard way to use a match filter is to have a kid template [B] (index.py in the above example) "extend" a match filter [A] (_layout.kid).  So the decision of what filter to use is embedded in the kid template [B] (index.kid).  What I'd like is for some other python code load in kid templates [A] and [B] and then apply the transformation [A] to [B] or some other content at my python code's whim.

-Winston


______________________________________________________

winston wolff - (646) 827-2242 - http://www.stratolab.com

learning by creating - video game courses for kids in new york



Reply via email to