Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-03-2012, 06:53 AM   #1
Bad Astronaut
Member
Bad Astronaut began at the beginning.
 
Posts: 20
Karma: 30
Join Date: Sep 2010
Device: Kindle 3
Generating TOC Section Names

I have an epub with section tags as follows:

Code:
<p class="calibre1"><a id="bookmark6" class="calibre2"></a>Introduction</p>
Other sections have random text names. I can recognize the sections using the expression
Code:
//*[re:test(@id, "bookmark.*", "i")]
However the sections are all called "Unnamed". I can see why, the text I'm after (eg. Introduction) is in a different tag than the one I'm searching for. Is there a way to get calibre to pick up the section names in this case?
Bad Astronaut is offline   Reply With Quote
Old 05-03-2012, 07:08 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: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Match the parent of that tag, something like

//*[re:test(@id, "bookmark.*", "i")]/..
kovidgoyal is offline   Reply With Quote
Advert
Old 05-03-2012, 02:45 PM   #3
Bad Astronaut
Member
Bad Astronaut began at the beginning.
 
Posts: 20
Karma: 30
Join Date: Sep 2010
Device: Kindle 3
Thanks Kovid, that did the trick!

Some day I'll actually learn regex...
Bad Astronaut is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem generating TOC ronin712 Calibre 11 09-06-2015 11:53 PM
Help generating TOC Diabolikul Conversion 3 01-26-2012 10:42 AM
New Calibre isn't generating TOC ccraig13 Conversion 2 10-07-2011 09:58 AM
TOC - Kindle - Not Generating superted Conversion 2 05-15-2011 07:28 AM
Trouble generating a TOC foghat Calibre 2 05-07-2010 06:00 PM


All times are GMT -4. The time now is 10:35 PM.


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