Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2018, 09: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-04-2018, 12:21 AM   #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: 33,747
Karma: 10215946
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://bugs.launchpad.net/calibre/+bug/1735799
kovidgoyal is offline   Reply With Quote
Old 09-04-2018, 11: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


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


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