View Single Post
Old 12-14-2015, 10:37 AM   #4
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,922
Karma: 207182180
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The bookcontainer (Edit-type plugin) object--usually represented "bk" in a plugin--has get|setmetadataxml() methods that can retrieve and set the xml portion of the opf file that deals wirh metadata. There's no need to parse the entire opf to get/set metadata.

bk.getmetadataxml()
parse metadata
meta = rebuilt metadata xml fragment
bk.setmetadataxml(meta)

Last edited by DiapDealer; 12-14-2015 at 10:44 AM.
DiapDealer is offline   Reply With Quote