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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2011, 12:08 AM   #1
HoushaSen
Junior Member
HoushaSen began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2011
Device: IPAD 2
HTML to EPUB TOC Creation XPath

I am new to the forum, and tried to search if anyone had similar question in the past and couldn't quite find exactly what I need, so I hope this is not duplicate.

I have mutiple HTML files that I like make into a single EPUB book. Following the guide, I was able to create EPUB book and created main TOC manually i.e. link to each web pages.

Now, the each web pages are organized in specific manner, but unforunately not in manner such that simple xpath syntax that the Calibre helper generate can handle. I wonder if someone can help me the actual syntax I need to get Subcategories parsed out from the following formatted HTML when converting to EPUB.

<div class="HNUM">Chapter 2</div>
<div class="HD">TITLE of Chapter 2</div>
</div>
<div class="BY">
<div class="PN">Author</div>
</div>
</div>
<div class="TBD">
<div class="TLV1 TLV1-noHD" id_xpath="/CHAPTER[1]/TBD[1]/TLV1[1]">
<div class="P">Blah Blah</div>
</div>
<div class="TLV1" id_xpath="/CHAPTER[1]/TBD[1]/TLV1[2]">
<div class="HD">Subcategory Title</div>
<div class="P">Blah Blah</div>
<div class="TLV2" id_xpath="/CHAPTER[1]/TBD[1]/TLV1[2]/TLV2[1]">
<div class="HD">Subsubcategory Title</div>
<div class="P">Blah Blah</div>

So as you can see above, essentially the site is organized in such that level 1 subcategory is in the div class="TLV1", and subcategory level 2 is under "TLV2"

So ideally I want to have EPUB version to have

Chapter 1
-Subcategory 1
--Subsubcategory 1-1
--Subsubcategory 1-2
-Subcategory 2
Chapter 2

It looks like the site developer was kind enough to give id_xpath tag, which essentially gives me the path such as /CHAPTER[1]/TBD[1], but issue here is actual TITLE is under <div class="HD">

So I believe what I need to have calibre select
Subcategory level 1 as
<DIV class="TLV1">'s child <div class = HD> but have no idea how to do this.

Please help

Last edited by HoushaSen; 03-13-2011 at 12:11 AM.
HoushaSen is offline   Reply With Quote
Old 03-13-2011, 11:02 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Have a look at this (And I don't believe Xpath is really involved)

http://calibre-ebook.com/user_manual/faq.html#id15
theducks is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC Creation taraboom11 Conversion 7 02-08-2011 12:40 AM
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
HTML Book + non HTML TOC to epub aarcane Calibre 4 03-02-2010 02:58 AM
Help on TOC creation MacZap Calibre 7 02-04-2009 12:43 AM


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


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