summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/xml/XmlOutput.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/xml/XmlOutput.cpp b/src/plugins/xml/XmlOutput.cpp
index 80b3af5..0d7b0dc 100644
--- a/src/plugins/xml/XmlOutput.cpp
+++ b/src/plugins/xml/XmlOutput.cpp
@@ -179,7 +179,9 @@ void XmlTransformer::writeXml(Handle<Document> doc, std::ostream &out,
}
}
Rooted<Element> ontology = transformOntology(document, o, P);
- document->addChild(ontology);
+ if (ontology != nullptr) {
+ document->addChild(ontology);
+ }
}
// write imports for all referenced typesystems.
for (auto t : doc->getTypesystems()) {
@@ -198,7 +200,9 @@ void XmlTransformer::writeXml(Handle<Document> doc, std::ostream &out,
}
}
Rooted<Element> typesystem = transformTypesystem(document, t, P);
- document->addChild(typesystem);
+ if (typesystem != nullptr) {
+ document->addChild(typesystem);
+ }
}
// transform the root element (and, using recursion, everything below it)