wat is markup block?But when I use that, how would I override the Markup
block with my markup?
On Mon, May 5, 2008 at 5:36 PM, Dan Eloff <[email protected]> wrote:
> I'm trying to think of the best way to solve this problem with
> Cheetah, and drawing a blank here. I'm hoping the Cheetah experts
> around here will say, "oh, didn't you read the manual, that's easy"
>
> In many cheetah templates I have a block of xml I repeat, often
> several times in the file. The data is different, but it follows a
> similar structure.
>
> <Style>
> <Key>foo</Key><Value>bar</Value>
> <Key>...</Key><Value>...</Value>
> ...
> <Markup>
> varied xml markup
> </Markup>
> </Style>
>
> It's a little more complex than that, but you get the idea. Each time
> the key/value pairs differ, and so does the markup.
>
> I got to thinking that there has to be a way to do this easier with
> Cheetah. It's easy to generate the key/value pairs with a list of
> tuples or a dict. But I don't want to pass markup around in python
> variables, in fact I don't want to enter it outside the xml file
> itself, I'd rather keep writing the boiler plate xml.
>
> I want to do something like:
>
> #def StyleTemplate(key_value_pairs, ...)
> #for k,v in key_value_pairs
> <Key>$k</Key><Value>$v</Value>
> #end for
> #block Markup
> #end block
> #end def
>
> But when I use that, how would I override the Markup block with my markup?
>
> Thanks,
> -Dan
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
>
--
Bidegg worlds best auction site
http://bidegg.com
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.