View Single Post
Old 12-14-2015, 09: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,657
Karma: 205039118
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 09:44 AM.
DiapDealer is online now   Reply With Quote