View Single Post
Old 08-09-2019, 06:23 AM   #21
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,691
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes, the xml declaration hurts nothing and affects nothing. That's why I didn't mention it. It's not relevant to writing the metadata soup back to the epub. But once again, the xmlprocessor.py file that we keep trying to point people to for examples of how to parse/serialize pure xml with sigil_bs4 has an example of how to easily strip the xml header.

As for the logic of adding the dc:language element or not; it was only ever intended as a simple example of diddling the metadata via bs4. If it doesn't work, then change the logic. My sample was addressing the proper way to parse/serialize pure xml fragments in a Sigil plugin. It's up to you to figure out how best to modify the metadata soup.
DiapDealer is offline   Reply With Quote