Revision 2550
Added by Aaron Marcuse-Kubitza over 12 years ago
map | ||
---|---|---|
4 | 4 |
# For outputting an XML file to a PostgreSQL database, use the general format of |
5 | 5 |
# http://vegbank.org/vegdocs/xml/vegbank_example_ver1.0.2.xml |
6 | 6 |
|
7 |
import copy |
|
7 | 8 |
import csv |
8 | 9 |
import itertools |
9 | 10 |
import os.path |
... | ... | |
315 | 316 |
|
316 | 317 |
if by_col: |
317 | 318 |
map_table(col_names, []) # just create the template |
318 |
xml_func.strip(root, ['_simplifyPath']) |
|
319 |
|
|
320 |
# Strip XML functions not in the DB |
|
321 |
preserve_funcs = copy.copy(db_xml.put_table_special_funcs) |
|
322 |
preserve_funcs.add(sql.tables(in_db, schema_like='%', |
|
323 |
table_like=r'\__%')) |
|
324 |
xml_func.strip(root, preserve_funcs) |
|
319 | 325 |
if debug: log_debug('Putting stripped:\n'+str(root)) |
320 | 326 |
# only calc if debug |
327 |
|
|
328 |
# Import rows |
|
321 | 329 |
in_row_ct_ref = [0] |
322 | 330 |
db_xml.put_table(in_db, root.firstChild, table, commit, |
323 | 331 |
in_row_ct_ref, row_ins_ct_ref, n, start) |
Also available in: Unified diff
bin/map: by_col: Strip only XML functions that are not in the DB