It looks as if you are trying to group adjacent paragraphs having the same tag name, which is very straightforward in XSLT 2.0 using <xsl:for-each-group group-adjacent=""/>. It's (much) more difficult in XSLT 1.0, but you will be able to find examples by googling for "positional grouping" or "sibling recursion".
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|