Happy new year
[pazpar2-moved-to-github.git] / src / normalize_record.c
index 9a81fb3..373cf6c 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Pazpar2.
-   Copyright (C) 2006-2012 Index Data
+   Copyright (C) Index Data
 
 Pazpar2 is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -178,6 +178,12 @@ int normalize_record_transform(normalize_record_t nt, xmlDoc **doc,
                 *doc = ndoc;
             else
            {
+                if (!ndoc)
+                    yaz_log(YLOG_WARN, "XSLT produced no document");
+                else if (!root)
+                    yaz_log(YLOG_WARN, "XSLT produced XML with no root node");
+                else if (!root->children)
+                    yaz_log(YLOG_WARN, "XSLT produced XML with no root children nodes");
                if (ndoc)
                    xmlFreeDoc(ndoc);
                return -1;