View Single Post
Old 01-09-2011, 10:26 PM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Try enabling the preprocess option under structure detection - one of the things it does is tries to detect common chapter headings and wrap them in <h2> tags so you don't have to. It's not always going to work, and can stick headings where you don't want them in rare cases, but generally should do ok.

If your book already has heading tags then that feature won't help you, you just need to look at the html to see what the right xpath needs to be.

You can make the default xpath match a lot more if you change it to this:
Code:
/*[((name()='h1' or name()='h2' or name()='h3') and re:test(., '.*', 'i')) or @class = 'chapter']
That may match too much, but if you're looking for a way to get more reliable 'rough' tocs that could help.

Last edited by ldolse; 01-09-2011 at 10:29 PM.
ldolse is offline   Reply With Quote