View Single Post
Old 10-26-2011, 09:11 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hymie View Post
Greetings.

I am trying to use Calibre to convert an e-book with lousy chapter marks.

A chapter is marked with
<span class="none">

However, there are other parts of the book (italic text) which are marked with
<span class="none1">

I'm trying to get an XPath that recognizes the difference.

//h:span[re:test(@class, "none", "i")] matches both sets
//h:span[re:test(@class, "none\b", "i")] matches both sets
//h:span[re:test(@class, "none$", "i")] matches nothing
//h:span[re:test(@class, '"none"', "i")] matches nothing

//h:span[re:test(@class, "["]none["]", "i")] is an invalid XPath
//*[@class="none"] matched nothing
//h:span[@class="none"] matched nothing

How can I properly find my chapters?

Thanks.

--hymie!
Are these spans of none and none1 only used for the chapter headers? If so, do a regex to replace the <span> and associated </span> with <h2> and </h2>. Then the xpath for h2 will work.
JSWolf is offline   Reply With Quote