diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-04-22 13:20:27 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-22 13:20:27 -0700 |
commit | 6f7e3d04cb737515b03243adc638fbc03e565c4d (patch) | |
tree | 0a8070cea96fac183e9db345130fbe8064e53409 /parse-xml.c | |
parent | 959077c66bd42d0b613a5ee54bc17fe3b9517bdd (diff) | |
download | subsurface-6f7e3d04cb737515b03243adc638fbc03e565c4d.tar.gz |
Handle XSLT based imports correctly
XSLT conversions create V2 XML files, but we shouldn't abort when we parse
those without having the user informed about the potential slowness - all
XSLT based imports are slow, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/parse-xml.c b/parse-xml.c index a02c4afac..819d3a8ca 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -24,6 +24,7 @@ int metric = 1; int last_xml_version = -1; bool abort_read_of_old_file = false; bool v2_question_shown = false; +bool imported_via_xslt = false; static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params); @@ -1681,7 +1682,7 @@ static bool entry(const char *name, char *buf) if (!strncmp(name, "version.program", sizeof("version.program") - 1) || !strncmp(name, "version.divelog", sizeof("version.divelog") - 1)) { last_xml_version = atoi(buf); - if (last_xml_version < 3 && !v2_question_shown) { + if (last_xml_version < 3 && !v2_question_shown && !imported_via_xslt) { // let's ask the user what they want to do about reverse geo coding // and warn them that opening older XML files can take a while // since C code shouldn't call the UI we set a global flag and bail @@ -1953,7 +1954,7 @@ int parse_xml_buffer(const char *url, const char *buffer, int size, } dive_end(); xmlFreeDoc(doc); - + imported_via_xslt = false; return ret; } @@ -3154,7 +3155,7 @@ static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params) } free((void *)attribute); } - + imported_via_xslt = true; xmlSubstituteEntitiesDefault(1); xslt = get_stylesheet(info->file); if (xslt == NULL) { |