XML writing when "publisher book series title" does not exist
cc @John.kopanas @andynicholson @sidorelauku
We write collection metadata into chapters and TOC converted files according to the rules in Column E in the Collections meta sheet
A "Book Series" collection has two title fields:
-
Title
-- required in the meta from -
Publisher's Book Series title
-- not required in the meta from
Here's an example of the collection node:
<book-part-wrapper content-type="dedication" id="dedication">
<collection-meta collection-type="ncbi-books-collection">
<collection-id collection-id-type="pmcid">bcms10000792collect</collection-id>
<title-group>
<title>Test book series collection 21 Dec</title>
</title-group>
</collection-meta>
<collection-meta collection-type="book-series">
<title-group>
<title>My pub book title</title>
</title-group>
</collection-meta>
Solution
If the user does not provide Publisher's Book Series title
in the meta form, excluded the entire <collection-meta collection-type="book-series">...</collection-meta>
node.
This should resolve the BCMS error: cheerio.load expects a string