Revision 30
Added by Aaron Marcuse-Kubitza about 13 years ago
data2xml | ||
---|---|---|
30 | 30 |
path = row[dest_idx] |
31 | 31 |
if name != '' and path != '': |
32 | 32 |
if path.startswith('?'): path = path[1:] |
33 |
has_types = path.find('/*s/') # *s used for type elem |
|
33 | 34 |
path = path.replace('<name>', name) |
34 |
path, repl_ct = re.subn(r'(?<=/)\*(?=s/(\w+))', r'\1', path) |
|
35 |
if repl_ct > 0: has_types = True # *s used for type elem |
|
36 |
path = re.sub(r'\*(?=\w*(?:->/\w+)?/(\w+))', r'\1', path) |
|
35 |
path = re.sub(r'\*(?=\w*(?:->/[^/]+)?/(\w+))', r'\1', path) |
|
37 | 36 |
mappings[name] = xpath.XpathParser(path).parse() |
38 | 37 |
stream.close() |
39 | 38 |
|
Also available in: Unified diff
Simplified expansion of * abbrs