View Full Version : XPath Help and Pagebreak


emellaich
07-27-2009, 09:59 PM
Hello all,

I'm just looking for some clarification on XPath. I've been playing around and its not doing what I expected, so I thought I would ask a quick question here. In the Calibre help it gives the following:

//h2[re:test(., 'chapter|section', 'i')]
(Selects <h2> tags that contain the words chapter or section)

What exactly is meant by contains? Does 1) or 2) below contain 'chapter'?

1) <h2 attribute=chapter>Headline</h2>

2) <h2>Chapter</h2>

Also, what do I do to force a pagebreak before a chapter break. I am converting from epub (html) to mobi. I've checked the appropriate meta data box, but it doesn't seem to be working. Maybe its my XPath problem. Or is there some other trick?

Nate the great
07-27-2009, 10:17 PM
I insert page breaks by hand. Here is what I use:

<div style="page-break-before:always" />

kovidgoyal
07-27-2009, 10:58 PM
2) and the calibre viewer doesn't support page breaks in MOBI, so check it with another viewer

emellaich
07-28-2009, 02:17 PM
Thanks for the info