Revision 3631
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/xml_func.py | ||
---|---|---|
343 | 343 |
'(see <http://en.wikipedia.org/wiki/Coefficient_of_variation>)') |
344 | 344 |
|
345 | 345 |
def _noCV(items, node): |
346 |
items = list(conv_items(strings.ustr, items)) |
|
346 | 347 |
try: name, value = items.pop() # last entry contains value |
347 | 348 |
except IndexError: return None # input is empty |
348 | 349 |
if re.match('^(?i)CV *\d+$', value): raise FormatException(CvException()) |
... | ... | |
422 | 423 |
name_parts = [name for name, slice_ in _name_parts_slices_items] |
423 | 424 |
|
424 | 425 |
def _name(items, node): |
425 |
items = dict(items)
|
|
426 |
items = dict(list(conv_items(strings.ustr, items)))
|
|
426 | 427 |
parts = [] |
427 | 428 |
for part in name_parts: |
428 | 429 |
if part in items: parts.append(items[part]) |
... | ... | |
430 | 431 |
funcs['_name'] = _name |
431 | 432 |
|
432 | 433 |
def _namePart(items, node): |
434 |
items = list(conv_items(strings.ustr, items)) |
|
433 | 435 |
out_items = [] |
434 | 436 |
for part, value in items: |
435 | 437 |
try: slice_ = name_parts_slices[part] |
Also available in: Unified diff
xml_func.py: Use conv_items() in every XML function that needs empty (NULL) entries removed, so that they are not dependent on what process() does to the items