mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
cee75b0f49
commit
3150c1a6e8
1 changed files with 5 additions and 0 deletions
|
@ -1538,12 +1538,17 @@ xmlDoc *test_xslt_transforms(xmlDoc *doc)
|
||||||
xmlDoc *transformed;
|
xmlDoc *transformed;
|
||||||
xsltStylesheetPtr xslt = NULL;
|
xsltStylesheetPtr xslt = NULL;
|
||||||
xmlNode *root_element = xmlDocGetRootElement(doc);
|
xmlNode *root_element = xmlDocGetRootElement(doc);
|
||||||
|
char *attribute;
|
||||||
|
|
||||||
while ((info->root) && (strcasecmp(root_element->name, info->root) != 0)) {
|
while ((info->root) && (strcasecmp(root_element->name, info->root) != 0)) {
|
||||||
info++;
|
info++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->root) {
|
if (info->root) {
|
||||||
|
attribute = xmlGetProp(xmlFirstElementChild(root_element), "name");
|
||||||
|
if (attribute && (strcasecmp(attribute, "subsurface") == 0))
|
||||||
|
return doc;
|
||||||
|
|
||||||
xmlSubstituteEntitiesDefault(1);
|
xmlSubstituteEntitiesDefault(1);
|
||||||
xslt = get_stylesheet(info->file);
|
xslt = get_stylesheet(info->file);
|
||||||
if (xslt == NULL)
|
if (xslt == NULL)
|
||||||
|
|
Loading…
Reference in a new issue