Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2010, 10:28 AM   #1
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Xpath TOC Expression

I have an html source file in which I use the <span class="chno"> tags to generate level 2 TOC entries. In calibre's conversion I set:

[Table of Contents] > [Level 2 TOC] > //h:span[re:test(@class, "chno", "i")]

I now want to extend this to use both <span class="chno"> tags and <h3 class="toc2"> tags to generate my level 2 TOC.

What should I use for the XPath expression to achieve this?
Agama is offline   Reply With Quote
Old 07-11-2010, 11:00 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,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
//h:span[re:test(@class, "chno", "i")]|//h:h3[re:test(@class, "toc2", "i")]
kovidgoyal is offline   Reply With Quote
Advert
Old 07-12-2010, 02:24 AM   #3
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Thanks, that does the job nicely.
Agama is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with XPath NASCARaddicted ePub 13 02-20-2015 06:04 AM
XPath Expression wizard?? tonyx3 Calibre 1 01-26-2010 04:49 AM
XPath question krischik Calibre 0 01-16-2010 08:22 AM
XPath Expression Wizard Error Crusader Calibre 4 12-27-2009 12:09 PM
XPath query amjbrown Calibre 2 05-10-2009 06:04 PM


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


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