For some reason I can't figure out the proper sequence of command-line parameters that would achieve my goals:
1) Only H2 and H3 tags are considered for chapters.
2) These tags must have class starting with either "part" or "chapter".
3) Nothing else is a chapter.
4) Page-breaks occur before any H2, but nowhere else.
I thought these parameters would do the trick:
--chapter="//*[re:test(name(), '^h', 'i') and re:test(@id, '^(chapter|part)', 'i')]"
It almost works, but goal #3 gives me trouble: If a book contains intra-document links (which I use for footnotes), they ALSO get added to the TOC. I thought that --no-chapters-in-toc would take care of that, but apparently that is not the case. What other option should I use then?