How would I change this
<CHAPT>
<CHAPTNO>1.1</CHAPTNO>
<SUBJ>Introduction</SUBJ>
<P>foo text</P>
<P>foo text</P> .. and so on
</CHAPT>
To this:
<p class="chapheader"><span class="chapnumbers">1.1 </span>Introduction</p>
<P>foo text</P>
<P>foo text</P>
But, only where <CHAPTNO> directly precedes <SUBJ> ..because there are other <SUBJ> in the XML that do not follow a <CHAPTNO> and I do not want those stand alone Subject Lines formatted as a Chapter header.
I’m new to XSLT and got stuck on my second template.
Try this. Here is my example XML ( I added a root element just for the test):
XSLT:
Resulting Output: