summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-02-07 21:20:02 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-08 07:50:55 +1100
commit3150c1a6e84a3ed988f093e314149a5530a8ccb3 (patch)
tree944916fff2fa4b683077e9f8d5905b22e2f4794e
parentcee75b0f498755ffde9af13a100f8516f78b4aa9 (diff)
downloadsubsurface-3150c1a6e84a3ed988f093e314149a5530a8ccb3.tar.gz
Skip XSL transformation for old Subsurface format
Making sure the XSL transformation does not occur on Subsurface's old XML format. A deeper inspection on the XML content is required as MacDive and Subsurface (old format) have the same root element (dives). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--parse-xml.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 2bc68c6bf..9c9e2abbc 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1538,12 +1538,17 @@ xmlDoc *test_xslt_transforms(xmlDoc *doc)
xmlDoc *transformed;
xsltStylesheetPtr xslt = NULL;
xmlNode *root_element = xmlDocGetRootElement(doc);
+ char *attribute;
while ((info->root) && (strcasecmp(root_element->name, info->root) != 0)) {
info++;
}
if (info->root) {
+ attribute = xmlGetProp(xmlFirstElementChild(root_element), "name");
+ if (attribute && (strcasecmp(attribute, "subsurface") == 0))
+ return doc;
+
xmlSubstituteEntitiesDefault(1);
xslt = get_stylesheet(info->file);
if (xslt == NULL)