diff --git a/planet/reconstitute.py b/planet/reconstitute.py index 1a914ec..29e371d 100644 --- a/planet/reconstitute.py +++ b/planet/reconstitute.py @@ -124,7 +124,11 @@ def author(xentry, name, detail): xdoc = xentry.ownerDocument xauthor = xdoc.createElement(name) - createTextElement(xauthor, 'name', detail.get('name', None)) + if detail.get('name', None): + createTextElement(xauthor, 'name', detail.get('name')) + else: + xauthor.appendChild(xdoc.createElement('name')) + createTextElement(xauthor, 'email', detail.get('email', None)) createTextElement(xauthor, 'uri', detail.get('href', None)) diff --git a/tests/data/reconstitute/author_noname.xml b/tests/data/reconstitute/author_noname.xml new file mode 100644 index 0000000..340ec7b --- /dev/null +++ b/tests/data/reconstitute/author_noname.xml @@ -0,0 +1,13 @@ + + + + + + john@example.com + + + +