Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2009, 04:46 PM   #1
amjbrown
Addict
amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.
 
amjbrown's Avatar
 
Posts: 322
Karma: 1231044
Join Date: Feb 2009
Location: London, UK
Device: Kindle Oasis 3, Kindle app on the iPhone
XPath query

I was hoping the group might be able to help me with some trouble I have been having at the very end of my first eBook conversion.

I have a file in Word which has Heading 1, 2 and 3s in it, where Heading 3 is the chapter headings, and I would like a TOC built from them.

The Word file looks perfect, I am using the latest Mac Office suite. I save as rtf, load the rtf file into TextEdit and save as HTML. Everything renders nicely in Safari, so I view the Heading 2 and Heading 3 lines in Text Wrangler to see they are wrapped with:

Code:
<p class="p4">
and

Code:
<p class="p5">
respectively.

I don't do HTML natively, but there are some CSS looking lines at the top, which define something akin to these classes, so I go with it.

The XPath help file has great examples if you are in the <h1> type world, but I try and adapt, and feed the following line in to the right box in the chapter detection dialogue...

Code:
//*[name()='<p class="p4">' or name()='<p class="p5">']
Makes no difference

How stupid am I being, and does anyone have any suggestions as to where I go?

To say I am new to this would be an understatement!

Thanks!

amjb
amjbrown is offline   Reply With Quote
Old 05-10-2009, 05:10 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
//*[@class="p4" or @class="p5"]
kovidgoyal is offline   Reply With Quote
Advert
Old 05-10-2009, 06:04 PM   #3
amjbrown
Addict
amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.amjbrown ought to be getting tired of karma fortunes by now.
 
amjbrown's Avatar
 
Posts: 322
Karma: 1231044
Join Date: Feb 2009
Location: London, UK
Device: Kindle Oasis 3, Kindle app on the iPhone
Magic!

Thanks so much
amjbrown is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with XPath NASCARaddicted ePub 13 02-20-2015 06:04 AM
Xpath TOC Expression Agama Calibre 2 07-12-2010 02:24 AM
XPath question krischik Calibre 0 01-16-2010 08:22 AM
XPath Help and Pagebreak emellaich Calibre 3 07-28-2009 02:17 PM
Xpath hierarchical structure mtravellerh Calibre 4 01-03-2009 02:40 PM


All times are GMT -4. The time now is 08:16 AM.


MobileRead.com is a privately owned, operated and funded community.