for example I have the XML code like this:
<quotes>
<quote>
<character>
<name>LA FEU</name>
</character>
</quote>
<quote>
<character>
<name>LA FEU</name>
</character>
</quote>
<quote>
<character>
<name>LA FEU</name>
</character>
</quote>
</quotes>
My XSLT code to transform this to HTML:
<html>
<body>
<pre>
<xsl:for-each select="quotes/quote">
<!--Output name of the character in underline-->
Name of character: <xsl:apply-templates select="//name"/>
</xsl:for-each>
</pre>
</body>
</html>
Output is like this: Name of character: LAFEULAFEULAFEU
HOw to make the NAME repeat only once every for-each? Would you please help me? THank you FOr example Name of character: LAFEU Name of character: LAFEU
Name of character: LAFEU
=================================================================================================
I would like to ask 1 more thing related to this question. IN case if CHARACTER is under QUOTES many layer, like this:
<quotes>
<quote>
<!--play 1-->
<play>
<playtitle>All's Well That Ends Well</playtitle>
<act>
<acttitle>ACT IV</acttitle>
<scene>
<scenetitle>SCENE I</scenetitle>
<speech>
<name>
<name>LAFEU</name>
</name>
................
HOw to refer to NAME in the For-each statement , I try this, but not work
<xsl:for-each select="quotes/quote">
<!--Output name of the character in underline-->
Name of character: <xsl:value-of select="play/*/name"/>
</xsl:for-each>
Would you please help me with this? THank you