Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2018, 08:00 PM   #1
marvinn
Junior Member
marvinn began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2018
Device: Kindle Voyage
Generate ToC from XPath Problem

I'm trying to create a table of contents based on XPath and running into a problem.

Every chapter is preceded by
Quote:
<p class="txtb2"> </p>
(That's a NO-BREAK SPACE between the p tags)

However, when I try to use the ToC editor wizard to add entries for
HTML tag = p
Attribute = class
Value = txtb2
only the first chapter gets an entry in the resulting ToC, every other instance is ignored. When I close the ToC editor, the code of the book gets updated so that each tag has been updated to something like:
Quote:
<p class="txtb2" id="toc_2"> </p>
but none of the entries beyond id="toc_1" were added to the ToC.

I created a ToC for another ebook with the same structure a few months ago with no problems, but maybe I've forgotten a subsequent step in the meantime. Can anyone help?
marvinn is offline   Reply With Quote
Old 09-03-2018, 11:21 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,331
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://bugs.launchpad.net/calibre/+bug/1735799
kovidgoyal is offline   Reply With Quote
Advert
Old 09-04-2018, 10:21 PM   #3
marvinn
Junior Member
marvinn began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2018
Device: Kindle Voyage
Thanks, Kovid. About an hour after posting I went and looked at the changelog for calibre and noticed that the behavior had in fact changed in the last version in the month between my book editing sessions. I temporarily downgraded to 3.29 to generate the ToC I needed.

I submitted a ticket requesting the XPath ignore duplicates to be an optional feature.
marvinn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
inline ToC via XPath? chaot Sigil 22 03-20-2017 10:06 PM
TOC from XPath Paulie_D Editor 5 05-26-2015 02:55 PM
Nested TOC / Xpath question halfgone Conversion 0 02-13-2012 07:46 PM
Calibre's XPath implementation for TOC detection tram Calibre 11 11-26-2010 04:14 PM
Xpath TOC Expression Agama Calibre 2 07-12-2010 02:24 AM


All times are GMT -4. The time now is 09:09 AM.


MobileRead.com is a privately owned, operated and funded community.