View Single Post
Old 01-03-2011, 08:31 AM   #10
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Manichean View Post
You used
Code:
//*[re:test(., "CHAPTER \d", "i")]
which tests for any occurence of the word "chapter" in upper- or lowercase followed by a single number and inside any tag. My XPath expression tests for an uppercase "CHAPTER" followed by one or more numbers inside a span tag, which itself is inside a p tag. Your expression, for whatever reasons, fits four incidences per chapter. Look at the source and figure it out. And look at the XPath tutorial I linked to earlier.
thanks for the extra explanation, but I still can't figure how i get exactly 4 in every chapter. FWIW all 4 toc entries jump to same chapter start.
let me post one sample chapter as zipped xhtml source & tell me what I'm missing here please. there are no strange files in the EPUB when I explode it, so my code is somehow deriving 4 instances from this source file
Attached Files
File Type: zip Section0014.zip (5.8 KB, 184 views)

Last edited by cybmole; 01-03-2011 at 08:33 AM.
cybmole is offline   Reply With Quote