[xsl] Generic template for collapsing arbitrary length runs of same tag into one tag?

Subject: [xsl] Generic template for collapsing arbitrary length runs of same tag into one tag?
From: Richard Bondi <rbondi@xxxxxxxxxx>
Date: Thu, 15 Aug 2002 12:59:35 -0400
[This is hopefully a clearer re-post of a post that was understood differently be different people.]

Dear All,

Consider the following example xml:

<root>
<Paragraph>While <Characters>S. cerevisiae</Characters> is the most commonly studied yeast, it is not the only yeast that has been studied. Two
<i>o</i><i>t</i><i>h</i><i>e</i><i>r</i>
yeasts have also been studied to an
<i>e</i><i>x</i><i>t</i><i>e</i><i>n</i><i>s</i><i>i</i><i>v</i><i>e</i>
degree. First, studies of <Characters>Schizosaccharomyces pombe</Characters> have made extremely important contributions to our understanding of the eukaryotic cell cycle.
</Paragraph>
</root>


This needs to be transformed to:

<root>
<Paragraph>While <Characters>S. cerevisiae</Characters> is the most commonly studied yeast, it is not the only yeast that has been studied. Two
<i>other</i>
yeasts have also been studied to an
<i>extensive</i>
degree. First, studies of <Characters>Schizosaccharomyces pombe</Characters> have made extremely important contributions to our understanding of the eukaryotic cell cycle.
</Paragraph>
</root>


This is an extract. Throughout the manuscript, there are runs of unpredictable length of always adjacent <i> tags. I cannot come up with a template which will collapse any such arbitrary-length run of adjacent <i>s into a single <i> tag. Can anyone here?

MTIA,
Richard Bondi


Keywords for archive search engine: merge tags, merging tags, collapse tags


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread