Basically this is my XML taken from an excerpt of a Shakespeare play:
<PLAY>
<PERSONA>BENEDICK, a young lord of Padua.</PERSONA>
<PERSONA>LEONATO, governor of Messina.</PERSONA>
<PERSONA>ANTONIO, his brother.</PERSONA>
<PERSONA>BALTHASAR, attendant on Don Pedro.</PERSONA>
<PGROUP>
<PERSONA>CONRADE</PERSONA>
<PERSONA>BORACHIO</PERSONA>
<GRPDESCR>followers of Don John.</GRPDESCR>
</PGROUP>
<PERSONA>FRIAR FRANCIS</PERSONA>
</PLAY>
Here's the XSL:
<xsl:template match="PLAY">
<html>
<body>
<xsl:for-each select="PERSONAE">
<xsl:apply-templates select="PERSONA" />
<xsl:apply-templates select="PGROUP/PERSONA" />
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="PERSONA">
<p><xsl:value-of select="." /></p>
</xsl:template>
<xsl:template match="PGROUP/PERSONA">
<xsl:for-each select=".">
<p><xsl:value-of select="." />, </p>
</xsl:for-each>
<xsl:for-each select="..">
<p><xsl:value-of select="GRPDESCR" /></p>
</xsl:for-each>
</xsl:template>
The current HTML output:
BENEDICK, a young lord of Padua.
LEONATO, governor of Messina.
ANTONIO, his brother.
BALTHASAR, attendant on Don Pedro.
FRIAR FRANCIS
CONRADE,
followers of Don John.
BORACHIO,
followers of Don John.
And this is what I want my HTML output to look like:
BENEDICK, a young lord of Padua.
LEONATO, governor of Messina.
ANTONIO, his brother.
BALTHASAR, attendant on Don Pedro.
FRIAR FRANCIS
CONRADE, BORACHIO, followers of Don John.
I've spent hours on this so any help would be so great!