Say I have an HTML or XML document like this:
<body>
<section>
<h1>This should be numbered 1</h1>
<section>
<h1>This should be numbered 1.1</h1>
<p>blah</p>
</section>
<section>
<h1>This should be numbered 1.2</h1>
<p>blah</p>
</section>
</section>
<section>
<h1>This should be numbered 2</h1>
<section>
<h1>This should be numbered 2.1</h1>
<p>blah</p>
</section>
</section>
</body>
This is merely an illustrative example; in general, there can be any number of child-sections within a section, and sections can be nested to any depth.
Is it possible to use CSS (counters and generated content) to generate the desired section-number at the start of each section-title?
The only examples I've seen where this sort of thing works is with nested lists, but there you can attach 'counter-reset' to OL and 'counter-increment' to LI. Here, it seems like you need 'section' to both reset for its child-sections, and increment wrt its parent section, and attaching both of those to one element-name doesn't work.