[xsl] How to emit opening and closing tags separately

Subject: [xsl] How to emit opening and closing tags separately
From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
Date: Mon, 8 Mar 2010 09:29:00 +0100
Processing a flat linear sequence of sibling nodes containing text
that may trigger the emission of some HTML header or paragraph text,
I'm faced with needing to emit a <p> due to one of the siblings, and
the matching </p> due to another, with some others contibuting to the
flesh of the paragraph.  (Emitting a paired <foo> </foo> and pulling
in all data that should be bracketed by this pair appears to be quite
tricky.)

Including an unmatched <p> in literal template text isn't possible,
and I can see why.

XSL Transformations (XSLT) Version 2.0 says that using with xsl:text
with disable-output-escaping="yes" is deprecated, and I think I should
avoid that.

So I'm using a a character map with + and ; as stand-ins for <p> and
</p>, which works fine and solves my current problem.

So my question is: If I had to split more than just one of the HTML
tags, is there some other method for creating split tags?

Thanks
Wolfgang

Current Thread