Got it - it's a bit of a blunt solution, but:
//*[((name()='h1' or name()='h2') and re:test(., '.*', 'i')) or @class = 'chapter']
Just returns everything in a h1 or h2. Worked fine for me.
Yes. I suggest that you learn how to use Calibre.David J Perry said:Can anyone suggest what I should do?
…is actually not part of the "Table of Contents" section of Calibre. It's part of the "Structure Detection" section. What you have asked Calibre to do with that command (that "XPath expression") is to detect where the chapters are.David J Perry said://*[((name()='h1' or name()='h2') and re:test(., '.*', 'i')) or @class = 'chapter']
…and yet you had to ask:David J Perry said:completely HTML savvy
There is an extremely simple HTML solution to that problem. Can you figure it out?David J Perry said:How can I achieve this in the HTML?
Err, I know. I was there...Word Fan said:The "solution" that you mention:
...is actually not part of the "Table of Contents" section of Calibre. It's part of the "Structure Detection" section. What you have asked Calibre to do with that command (that "XPath expression") is to detect where the chapters are.
But that's the point, isn't it?Word Fan said:You previously referred to yourself as: HTML Savvy
...and yet you had to ask: How can I achieve this in HTML?
My point was---and I tried to be gentle about it---was that you didn't provide a solution for others. You "fudged" through something that worked for you in that particular instance, but it could easily mess up a book that some neophyte somewhere was trying to format in the future.David J Perry said:I'm not sure what your post is for? I solved my problem, and included the solution in case it helped others.
I don't think Vellum will do a multilevel TOC, which I believe is what the person is attempting to do.Download Vellum and save yourself the headache.
Section 1
Chapter 1
Chapter 2
Section 2
Chapter 1
Chapter 2