Project

General

Profile

« Previous | Next » 

Revision 4335

xml_func.py: Added _first() simplifying function

View differences:

lib/xml_func.py
203 203
simplifying_funcs['_merge'] = passthru
204 204
simplifying_funcs['_name'] = passthru
205 205

  
206
def _first(node):
207
    '''Chooses the first param (after sorting by numeric param name)'''
208
    args = variadic_args(node)
209
    try: first = args[0]
210
    except IndexError: first = None
211
    xml_dom.replace(node, first)
212
simplifying_funcs['_first'] = _first
213

  
206 214
##### XML functions
207 215

  
208 216
# Function names must start with _ to avoid collisions with real tags

Also available in: Unified diff