I\'m trying to write an XSLT that organizes an HTML file into different section levels depending on the header level. Here is my input:
Here is an XSLT 2.0 stylesheet:
It should do what you asked for, although it does not stop at four nested levels but rather groups as long as it finds h[n] elements.
h[n]