Changes between Initial Version and Version 1 of Ticket #296
- Timestamp:
- Mar 12, 2009, 9:14:08 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #296 – Description
initial v1 1 1 Currently to generate elements from a list some hackery is needed, ie: 2 2 3 {{{ 4 #!genshi 3 5 <?python from genshi.builder import tag ?><py:for each='field in fields'>${getattr(tag,field)}</py:for> 6 }}} 4 7 5 8 It would be cleaner if we could instead: 9 10 {{{ 11 #!genshi 6 12 <py:for each='field in fields'><py:element name="field"/></py:for> 13 }}} 7 14 8 py:attrsshould be applied second such that:15 `py:attrs` should be applied second such that: 9 16 17 {{{ 18 #!genshi 10 19 <py:for each='field in fields'><py:element name='field' py:attrs='fields[field]'/></py:for> 11 20 }}} 12 21 It would be useful if the element name could contain the namespace, ie: 13 22 23 {{{ 24 #!python 14 25 fields = {'greek:alpha' : {'value' : 1, 'xmlns:greek' = 'xml:foo:greek'}, 15 26 'game:monsters' : {'hp' : 552, 'label' : 'Queen Banshee'}} 27 }}} 16 28 17 29 In XMPP there are many cases where it'd be useful for generated elements to be in different namespaces like this. A separate py:element namespace= attribute may also be useful in some situations but would increase complexity in the above examples.