Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-14-2010, 11:05 PM   #1
armjorge
Junior Member
armjorge began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2010
Device: HTC
Post 4 levels xpath table of contents

Hello everybody!! I'm trying to make a table of contents of a big medical book, a well build index is indispensable (Pathologic Basis of disease).
The book has a structure based on css classes and atributes:

<span class="chapter-title"> title of chapter </span>
<span class="section-title-1"> Title of section </span>
<span class="section-title-2"> Subtitle </span>
<span class="section-title-3"> Sub-subtitle </span>

And Calibre has the instructions:

//h:span[re:test(@class, "chapter-title", "i")]
//h:span[re:test(@class, "section-title-1", "i")]
//h:span[re:test(@class, "section-title-2", "i")]

Anybody could help me to add the instruction:
//h:span[re:test(@class, "section-title-3", "i")]

It'doesnt matter if section-title-2 are shown with section-title-3, the point is show both entries. So I tryed to add a double instruction, like this:

//h:span[re:test(@class, "section-title-1", "section-title-2", "i")]
and this:
//h:span[re:test(@class, "section-title-1" or "section-title-2", "i")]
and this:
//h:span[re:test(@class, "section-title-1", "i")(@class, "section-title-2", "i")]

But this fail.

¿can you help me?

Thanks a lot for your time.
armjorge is offline   Reply With Quote
Old 11-14-2010, 11:24 PM   #2
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
If your original re:test version worked, all you need do is add another re:test after an or:
Code:
//h:span[re:test(@class, "section-title-2", "i") or re:test(@class, "section-title-3", "i")]
Otherwise, try:
Code:
//*[@class = 'chapter-title']
//*[@class = 'chapter-title-1']
//*[@class = 'chapter-title-2' or @class = 'chapter-title-3']
wallcraft is offline   Reply With Quote
Advert
Old 11-14-2010, 11:34 PM   #3
armjorge
Junior Member
armjorge began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2010
Device: HTC
Quote:
Originally Posted by wallcraft View Post
If your original re:test version worked, all you need do is add another re:test after an or:
Code:
//h:span[re:test(@class, "section-title-2", "i") or re:test(@class, "section-title-3", "i")]
Otherwise, try:
Code:
//*[@class = 'chapter-title']
//*[@class = 'chapter-title-1']
//*[@class = 'chapter-title-2' or @class = 'chapter-title-3']
Thank's a lot. I'm working in this right now.
armjorge is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents peterinnes Sigil 1 09-29-2010 03:03 AM
Help with my Table of Contents Skylinefranc Calibre 0 03-19-2010 12:55 AM
How to: table of contents wizzofoz Sigil 1 10-08-2009 08:22 AM
only the table of contents wang960 Sony Reader 3 08-29-2008 12:45 PM
Creator Table of Contents Nate the great Kindle Formats 5 07-10-2008 05:55 AM


All times are GMT -4. The time now is 04:33 PM.


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