diff --git a/frontends/src/jp/cmd_pubsub.py b/frontends/src/jp/cmd_pubsub.py index e65046e9..7fb27c8b 100644 --- a/frontends/src/jp/cmd_pubsub.py +++ b/frontends/src/jp/cmd_pubsub.py @@ -420,11 +420,13 @@ class NodeSchemaEdit(base.CommandBase, common.BaseEdit): except ImportError: self.disp(u"lxml module must be installed to use edit, please install it with \"pip install lxml\"", error=True) self.host.quit(1) - parser = etree.XMLParser(remove_blank_text=True) - schema_elt = etree.fromstring(schema, parser) content_file_obj, content_file_path = self.getTmpFile() - content_file_obj.write(etree.tostring(schema_elt, encoding="utf-8", pretty_print=True)) - content_file_obj.seek(0) + schema = schema.strip() + if schema: + parser = etree.XMLParser(remove_blank_text=True) + schema_elt = etree.fromstring(schema, parser) + content_file_obj.write(etree.tostring(schema_elt, encoding="utf-8", pretty_print=True)) + content_file_obj.seek(0) self.runEditor("pubsub_schema_editor_args", content_file_path, content_file_obj) def start(self):