View Single Post
Old 05-30-2010, 12:27 PM   #5
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,977
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
I have used a modified version of the standard Chapters and page breaks expression:
Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|0|1|2|3|4|5|6|7|8|9\s+', 'i')) or @class = 'chapter']
This just keys on any number in an h1 or h2, and, as Stinger suggests, this may not be best for all ebooks. So I only use the above when the standard version fails. This probably isn't the cleanest way to test for digits, but it works.
wallcraft is offline   Reply With Quote