Edgewall Software

Changes between Initial Version and Version 1 of Ticket #296

Show
Ignore:
Timestamp:
03/12/09 09:14:08 (5 years ago)
Author:
cmlenz
Comment:

(add some formatting to the description)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #296 – description

    initial v1  
    11Currently to generate elements from a list some hackery is needed, ie: 
    22 
     3{{{ 
     4#!genshi 
    35<?python from genshi.builder import tag ?><py:for each='field in fields'>${getattr(tag,field)}</py:for> 
     6}}} 
    47 
    58It would be cleaner if we could instead: 
     9 
     10{{{ 
     11#!genshi 
    612<py:for each='field in fields'><py:element name="field"/></py:for> 
     13}}} 
    714 
    8 py:attrs should be applied second such that: 
     15`py:attrs` should be applied second such that: 
    916 
     17{{{ 
     18#!genshi 
    1019<py:for each='field in fields'><py:element name='field' py:attrs='fields[field]'/></py:for> 
    11  
     20}}} 
    1221It would be useful if the element name could contain the namespace, ie: 
    1322 
     23{{{ 
     24#!python 
    1425fields = {'greek:alpha' : {'value' : 1, 'xmlns:greek' = 'xml:foo:greek'}, 
    1526          'game:monsters' : {'hp' : 552, 'label' : 'Queen Banshee'}} 
     27}}} 
    1628 
    1729In 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.