do not write empty metadata nodes in book AND collection xml
Expected behaviour
When a meta value is not provided in the UI, no xml node for that values should be written
Current behaviour
In collection.xml files (Collection TOCS) some empty nodes are written
-
<role/
-- this results in the publishing failed error, see example here: https://ncbidev.cloud68.co/organizations/a2c1e381-f348-41a9-9d76-e4f11f761033/collectionmanager/316eda9b-6404-4e47-a837-32de5f94edcf/toc/41e73137-c0e5-4ba1-9afe-195d3a962fab
TOC.pxml: STYLE ERROR.<br>role should not be empty (context: /book-part-wrapper/book-meta/contrib-group/contrib[1]/role )}<br>
-
<degrees/>
-- though this does not result in a error
Steps to reproduce
- create collection
- add meta and leave
role
anddegree
blank - publish the TOC
- see error report
Note: empty nodes do not get written for these same values in book meta when written into chapter files. For example see here: ch04__1_.xml
NCBI spec feedback
Please see the Bookshelf tagging guidelines on Empty Elements: https://www.ncbi.nlm.nih.gov/pmc/pmcdoc/tagging-guidelines/book/genprac.html#emptyele
Do not use empty elements for formatting or any other purpose. All required elements (that are not defined as EMPTY in the DTD) should have content.
Priority
Y, for deployment.