parent
ef6bfa9046
commit
560a2306dc
|
@ -141,7 +141,10 @@ class EPUB(zipfile.ZipFile):
|
|||
raise InvalidEpub("Cannot process an EPUB without unique-identifier attribute of the package element")
|
||||
# Get and parse the TOC
|
||||
toc_id = self.opf[2].get("toc")
|
||||
if toc_id:
|
||||
expr = ".//{0}item[@id='{1:s}']".format(NAMESPACE["opf"], toc_id)
|
||||
else:
|
||||
expr = ".//{0}item[@properties='nav']".format(NAMESPACE["opf"])
|
||||
toc_name = self.opf.find(expr).get("href")
|
||||
self.ncx_path = os.path.join(self.root_folder, toc_name)
|
||||
self.ncx = ET.fromstring(self.read(self.ncx_path))
|
||||
|
|
Loading…
Reference in New Issue