Revision 5190
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/xml_func.py | ||
---|---|---|
1 | 1 |
# XML "function" nodes that transform their contents |
2 | 2 |
|
3 | 3 |
import datetime |
4 |
import operator |
|
4 | 5 |
import re |
5 | 6 |
import sre_constants |
6 | 7 |
import warnings |
... | ... | |
147 | 148 |
# pass-through optimization for aggregating functions with one arg |
148 | 149 |
value = items[0][1] # pass through first arg |
149 | 150 |
elif row_mode and (is_rel_func(name) or func == None): # row-based mode |
151 |
if reduce(operator.or_, (xml_dom.is_node(v) for n, v in items)): |
|
152 |
return # preserve complex funcs |
|
150 | 153 |
try: value = sql_io.put(db, name, dict(items)) # evaluate using DB |
151 | 154 |
except sql.DoesNotExistException: return # preserve unknown funcs |
152 | 155 |
# possibly a built-in function of db_xml.put() |
Also available in: Unified diff
xml_func.py: process(): Fixed bug where need to preserve complex functions that have unevaluated XML nodes as arguments, because XML nodes are not accepted by sql_io.put() (they are handled by db_xml.put())