From 3150c1a6e84a3ed988f093e314149a5530a8ccb3 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Thu, 7 Feb 2013 21:20:02 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- parse-xml.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'parse-xml.c') 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) -- cgit v1.2.3-70-g09d2