![]() |
#1 |
Captain Courageous
![]() ![]() Posts: 239
Karma: 102
Join Date: Apr 2009
Device: calibre, PRS 505
|
![]()
I need an xpath for just roman numerals to put in "Structure Detection" > "Detect Chapters at" part of the conversion dialog. Each Chapter heading is on a line by itself and consists of just a roman numeral.Thanks,
Paul |
![]() |
![]() |
![]() |
#2 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,892
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Good Luck. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Captain Courageous
![]() ![]() Posts: 239
Karma: 102
Join Date: Apr 2009
Device: calibre, PRS 505
|
Thanks, but that was the first thing tried. I've never really had much luck with Heuristic Processing. What seems logically simple, HP just ignores.
here is wan example of the first chapter: I: In which Two Men go forth and One Arrives What could be more obvious than a Roman Numeral? This is the latest thing I've tried: //*[re:test(., '^[I-XXIII]+:$')] |
![]() |
![]() |
![]() |
#4 | |
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,977
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
Quote:
Code:
//*[re:test(., '^[IXV]+:')] |
|
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,919
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I would include 'LC' in your set of possible Roman numerals (50,100) for other books that have more that 39 chapters (XL onwards)
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Captain Courageous
![]() ![]() Posts: 239
Karma: 102
Join Date: Apr 2009
Device: calibre, PRS 505
|
Hi Wallcraft! once again you've come through for me! I like your suggestion also, "theducks"!
My reason for putting in the dash was to include numerals from I(1) to XXIII(23) in case the chapters went that high. I knew they didn't go above XXIII. and all I had to use was a previous xpath statement you gave me: //*[re:test(., '^CHAPTER [I-XXIII]+$')] so I deleted "CHAPTER" In the case of the xpath above, wallcraft, you only used one set of RN; IXV but the program detected all the chapters in the book which went up to XVIII. Why did it do that? I'm confused. Why wouldn't my "I-XXIII" work? Thanks, Paul |
![]() |
![]() |
![]() |
#7 |
Captain Courageous
![]() ![]() Posts: 239
Karma: 102
Join Date: Apr 2009
Device: calibre, PRS 505
|
OH, I think I see! Does the "IXV" mean all characters that are I or X or V ? Well I have another xpath to add to my list!
Last edited by p3aul; 04-08-2012 at 01:35 PM. Reason: self-applied power to my lightbulb! |
![]() |
![]() |
![]() |
#8 |
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,977
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
The "+" means one or more instances of the preceding character, which (from the []) can be an I or a X or a V. As theducks said, [IXVLC] would cover more cases.
|
![]() |
![]() |
![]() |
#9 |
Captain Courageous
![]() ![]() Posts: 239
Karma: 102
Join Date: Apr 2009
Device: calibre, PRS 505
|
Thanks all! I've been collecting all these xpath statements in a file I call Calibre tips and tricks. I'mm also learning a little about xpath along the way.
Paul |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter Headings | Paxman53 | Conversion | 3 | 10-12-2011 12:31 PM |
Why H1 and H2 Chapter Headings? | Ransom | Calibre | 11 | 08-10-2011 04:29 PM |
Help converting chapter headings | p3aul | Conversion | 6 | 04-03-2011 12:56 PM |
Xpath expression for detecting chapter marks | p3aul | Calibre | 5 | 11-14-2010 11:14 PM |
xpath for chapter detection | romnempire | Calibre | 7 | 07-26-2010 05:34 PM |