Hello Goodbye Match

27 January 2009
17:06

By cmlenz as Python

1 from genshi.template import MarkupTemplate
2
3 print MarkupTemplate('''
4 <doc xmlns:py="http://genshi.edgewall.org/">
5
6 <div id="hello" py:match="div[@id='hello']" py:attrs="select('@*')">
7 ${select('*|text()')}
8 <div if="goodbye"></div>
9 </div>
10
11 <div id="hello">Yo</div>
12
13 </doc>
14 ''').generate()
15

Download Raw Source

Comments

No comments so far.