View Single Post
Old 02-14-2011, 11:28 AM   #1
RachDvn
Member
RachDvn has a complete set of Star Wars action figures.RachDvn has a complete set of Star Wars action figures.RachDvn has a complete set of Star Wars action figures.RachDvn has a complete set of Star Wars action figures.
 
RachDvn's Avatar
 
Posts: 24
Karma: 322
Join Date: Jan 2011
Device: Kindle
[Old Thread] html/zip to mobi not detecting chapter breaks

I have documents that I created in Word, saved as a web page, and am converting to mobi with Calibre. For the life of me, I can't get the chapters to be detected for a page break!

I posted a while back with a simialr problem for azw to mobi and someone was kind enough to help me edit the xpath for detecting chapters. That code is working beautifully for my azw files, but seems no luck for these html files. I've tried selecting the Heuristic option "Detect & markup unformatted chapter headings..." but hasn't made a difference. Have run a debug and I can't figure it out.

If anyone has any suggestions, I would be very appreciative!

My current Xpath is:
Code:
//*[((name()='span' or name()='h2') and re:test(., 'chapter|ch|book|section|part|pt|prologue|epilogue\s+', 'i') and (@class = 'bold')) ]
An example section surrounding an undefined Chapter:
Code:
"Alright, what I'd
like to do now is shoot some backlit winter shots, something that might be good
for a January or March scene. I'd like to have you on the skis in a full tuck
position, as if you were rounding a corner on a downhill slope. If you're
comfortable, I'd like to have you strip completely, or if you prefer, I have a
thong you can wear."</span></p>
<p class="MsoNormal" align="center" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;text-align:center;line-height:normal"><span style="font-size:14.0pt; font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:&quot;Times New Roman&quot;; color:black">
</span></p>
<p class="MsoNormal" align="center" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;text-align:center;line-height:normal"><span style="font-size:14.0pt; font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:&quot;Times New Roman&quot;; color:black">Chapter 2</span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal"><span style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;; mso-fareast-font-family:&quot;Times New Roman&quot;;color:black">The incredulous look
must have been plain on my face. As she realized how her offer sounded, her
face turned red and she quickly clarified, "Not one of <i>my </i>thongs.
Not that I'm trying to say that I even <i>have</i> thongs," her cheeks
were starting to remind me of the <span class="SpellE"><span class="GramE">claymation</span></span>
Rudolph when his nose cover popped off. "I just mean that I have a brand
new men's thong you can wear and I can Photoshop out the lines on your
hips."
Thanks so much!
~Rach
RachDvn is offline   Reply With Quote