File: Data.xml
First Chapter
Second Chapter
Subchapter 1
Subchapter 2
Third Chapter
Subchapter A
Subchapter B
sub a
sub b
Subchapter C
File: Transform.xslt
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Number
text
Output:
Number text 1 First Chapter 2
Second Chapter
2.1 Subchapter 1 2.2 Subchapter 2 3
Third Chapter
3.1 Subchapter A 3.2
Subchapter B
3.2.1 sub a 3.2.2 sub b 3.3 Subchapter C