xslt desired output

Hello Gentone and other professioanls,

I have the attached xslt and the source document. The out is the following:

A Clockwork Orange    La naranja mecánica

House of Wax               La casa de cera

I want the output to be the following:

A

A Clockwork Orange                           La naranja mecánica
Around The World In 80 Days              La vuelta al mundo en ochenta días

H

House of Wax               La casa de cera

I gives the correct output but without putting the initials for each block...

Any help is highly appreciated...

Cheers,
- ------XSLT
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:key name="initial" match="translation" use="@initial"/>
    <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
         method="html" version="4.0" omit-xml-declaration="yes"/>
		 <!--key for uniqueness (Muenchian on the initial attribute) -->
    <xsl:template match="Dictionary">
        <html>
				<head>
                <title> Bilingual Lexicon <xsl:value-of select="/Dictionary/from" />-<xsl:value-of select="/Dictionary/to" /></title>
               
					<link type="text/css" rel="stylesheet" href="dictionary.css" />
                </head>
            <body>
                <h3>Browse by letter</h3>
                <p>
                    <xsl:apply-templates select="translation[generate-id() = generate-id(key('initial', @initial)[1])]" mode="TOC" >
						<!-- Muenchian grouping, used to push out only the nodes with a unique initial attribute  -->
                        <xsl:sort select="@initial" order="ascending" data-type="text"/>
						<!-- The unique nodes for the initials in the TOC will be sorted -->
                    </xsl:apply-templates>
                </p>
                <table >
                    <tr><td width="50%">search</td><th>replace</th></tr>
					<!-- second apply-templates, now inside a table for generating a line for a node, sorted on initial -->
					<!--second apply-templates, now inside a table for generating a line for a node, sorted on initial-->
                    <xsl:apply-templates select="translation" mode="FLOW">
                    <xsl:sort select="@initial" order="ascending" data-type="text"/>
                    </xsl:apply-templates>
                    
                </table>
            </body>
        </html>
    </xsl:template>
	<!-- for unique initial nodes, a link is generated --> 
    <xsl:template match="translation" mode="TOC">
        <a href="{concat('#Dictionary', @initial)}">
            <b><xsl:value-of select="@initial" /></b>
        </a>
        <xsl:text>&#160; </xsl:text>
    </xsl:template>
    <!--for the flow, a table row is generated per translation -->
    <xsl:template match="translation" mode="FLOW">
	<!-- I create a boolean variable that is true if there is no preceding sibling with the same @initial 
		This will be set to true() if t is the first translation with a certain initial
		will be used to put the named anchor for the in-document link -->
        <xsl:variable name="is-first-initial" select="not(preceding-sibling::translation[@initial = current()/@initial])"/>
        <tr>
            <td>
			<!--named anchor for in-document link-->
                <xsl:if test="$is-first-initial">
                    <a name="{concat('Dictionary', @initial)}"></a>
                </xsl:if>
                <xsl:value-of select="search"/>
            </td>
            <td>
                <xsl:for-each select="replace">
				<!--looping over each replace in the translation, seperating values with ';', unless first-->
                    <xsl:if test="not(position() = 1)">
                        <xsl:text>; </xsl:text>
                    </xsl:if>
                    <xsl:value-of select="."/>
                </xsl:for-each>
            </td>
        </tr>
    </xsl:template>

</xsl:stylesheet>

---- source document
<?xml version="1.0" encoding="UTF-8"?>
<Dictionary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="translation.xsd">
   <from>en</from>
   <to>es</to>
   <translation initial="A">
      <search>A Clockwork Orange</search>
      <counter>1</counter>
      <replace>La naranja mecánica</replace>
   </translation>
   <translation initial="A">
      <search>A Few Good Men</search>
      <counter>1</counter>
      <replace>A Few Good Men</replace>
   </translation>
   <translation initial="A">
      <search>A Star Is Born</search>
      <counter>1</counter>
      <replace>Ha nacido una estrella</replace>
   </translation>
   <translation initial="A">
      <search>Ab Urbe condita</search>
      <counter>1</counter>
      <replace>Ab Urbe condita libri</replace>
   </translation>
   <translation initial="A">
      <search>Ab urbe condita</search>
      <counter>2</counter>
      <replace>Ab urbe condita</replace>
      <replace>Ab urbe condita</replace>
   </translation>
   <translation initial="A">
      <search>Abel</search>
      <counter>4</counter>
      <replace>Abel</replace>
      <replace>Caín</replace>
      <replace>Abel</replace>
      <replace>Caín</replace>
   </translation>
   <translation initial="A">
      <search>Alyosha Karamazov</search>
      <counter>1</counter>
      <replace>Los hermanos Karamazov</replace>
   </translation>
   <translation initial="A">
      <search>And Then There Were None</search>
      <counter>1</counter>
      <replace>Diez negritos</replace>
   </translation>
   <translation initial="A">
      <search>Angst</search>
      <counter>1</counter>
      <replace>Gaslight</replace>
   </translation>
   <translation initial="G">
      <search>Gaslight</search>
      <counter>1</counter>
      <replace>Gaslight</replace>
   </translation>
   <translation initial="A">
      <search>Around The World In 80 Days</search>
      <counter>1</counter>
      <replace>La vuelta al mundo en ochenta días</replace>
   </translation>
   <translation initial="A">
      <search>Around the World in Eighty Days</search>
      <counter>1</counter>
      <replace>La vuelta al mundo en ochenta días</replace>
   </translation>
   <translation initial="B">
      <search>Batman &amp; Robin</search>
      <counter>1</counter>
      <replace>Batman y Robin</replace>
   </translation>
   <translation initial="B">
      <search>Bomarzo</search>
      <counter>1</counter>
      <replace>Bomarzo</replace>
   </translation>
   <translation initial="B">
      <search>Brave New World</search>
      <counter>1</counter>
      <replace>Un mundo feliz</replace>
   </translation>
   <translation initial="C">
      <search>Casino Royale</search>
      <counter>1</counter>
      <replace>Casino Royale</replace>
   </translation>
   <translation initial="C">
      <search>Cheaper by the Dozen</search>
      <counter>1</counter>
      <replace>Más barato por docena</replace>
   </translation>
   <translation initial="C">
      <search>Cinderella</search>
      <counter>1</counter>
      <replace>La Cenicienta</replace>
   </translation>
   <translation initial="D">
      <search>Da Vinci Code</search>
      <counter>1</counter>
      <replace>El código Da Vinci</replace>
   </translation>
   <translation initial="D">
      <search>Dawn of the Dead</search>
      <counter>1</counter>
      <replace>El amanecer de los muertos</replace>
   </translation>
   <translation initial="D">
      <search>Diary of a Chambermaid</search>
      <counter>1</counter>
      <replace>Diario de una camarera</replace>
   </translation>
   <translation initial="D">
      <search>Dune</search>
      <counter>1</counter>
      <replace>Dune</replace>
   </translation>
   <translation initial="E">
      <search>Evil Dead</search>
      <counter>1</counter>
      <replace>Posesión infernal</replace>
   </translation>
   <translation initial="F">
      <search>Frankenstein</search>
      <counter>1</counter>
      <replace>Frankenstein</replace>
   </translation>
   <translation initial="F">
      <search>Fyodor Karamazov</search>
      <counter>1</counter>
      <replace>Los hermanos Karamazov</replace>
   </translation>
   <translation initial="G">
      <search>General San Martín Park</search>
      <counter>1</counter>
      <replace>Parque General San Martín</replace>
   </translation>
   <translation initial="G">
      <search>Gentlemen Prefer Blondes</search>
      <counter>1</counter>
      <replace>Los caballeros las prefieren rubias</replace>
   </translation>
   <translation initial="G">
      <search>Goldfinger</search>
      <counter>1</counter>
      <replace>Goldfinger</replace>
   </translation>
   <translation initial="H">
      <search>Haitian Creole</search>
      <counter>1</counter>
      <replace>Criollo haitiano</replace>
   </translation>
   <translation initial="H">
      <search>Haitian language</search>
      <counter>1</counter>
      <replace>Criollo haitiano</replace>
   </translation>
   <translation initial="H">
      <search>Hamlet</search>
      <counter>1</counter>
      <replace>Hamlet</replace>
   </translation>
   <translation initial="H">
      <search>House of Wax</search>
      <counter>1</counter>
      <replace>La casa de cera</replace>
   </translation>
   <translation initial="I">
      <search>I, Robot</search>
      <counter>1</counter>
      <replace>Yo, Robot</replace>
   </translation>
   <translation initial="I">
      <search>Il Gattopardo</search>
      <counter>1</counter>
      <replace>El gatopardo</replace>
   </translation>
   <translation initial="I">
      <search>In Cold Blood</search>
      <counter>1</counter>
      <replace>A sangre fría</replace>
   </translation>
   <translation initial="I">
      <search>Interview with the Vampire</search>
      <counter>1</counter>
      <replace>Entrevista con el Vampiro</replace>
   </translation>
   <translation initial="I">
      <search>Ivan Karamazov</search>
      <counter>1</counter>
      <replace>Los hermanos Karamazov</replace>
   </translation>
   <translation initial="J">
      <search>John Robert Schrieffer</search>
      <counter>1</counter>
      <replace>John Robert Schrieffer</replace>
   </translation>
   <translation initial="J">
      <search>J Robert Schrieffer</search>
      <counter>1</counter>
      <replace>John Robert Schrieffer</replace>
   </translation>
   <translation initial="J">
      <search>Joseph K</search>
      <counter>1</counter>
      <replace>El proceso</replace>
   </translation>
   <translation initial="J">
      <search>Journey to the Center of the Earth</search>
      <counter>1</counter>
      <replace>Viaje al centro de la Tierra</replace>
   </translation>
   <translation initial="L">
      <search>La Boheme</search>
      <counter>2</counter>
      <replace>La Bohème</replace>
      <replace>La Bohème</replace>
   </translation>
   <translation initial="L">
      <search>La bohème</search>
      <counter>2</counter>
      <replace>La Bohème</replace>
      <replace>La Bohème</replace>
   </translation>
   <translation initial="L">
      <search>Les Miserables</search>
      <counter>1</counter>
      <replace>Los miserables</replace>
   </translation>
   <translation initial="L">
      <search>Les Misérables</search>
      <counter>1</counter>
      <replace>Los miserables</replace>
   </translation>
   <translation initial="L">
      <search>Librarians in the Name of the Rose</search>
      <counter>1</counter>
      <replace>El nombre de la rosa</replace>
   </translation>
   <translation initial="L">
      <search>Lolita</search>
      <counter>1</counter>
      <replace>Lolita</replace>
   </translation>
   <translation initial="L">
      <search>Lord of the Flies</search>
      <counter>1</counter>
      <replace>El señor de las moscas</replace>
   </translation>
   <translation initial="L">
      <search>Lord of the Flies in popular culture</search>
      <counter>1</counter>
      <replace>El señor de las moscas</replace>
   </translation>
   <translation initial="M">
      <search>M</search>
      <counter>1</counter>
      <replace>M, el vampiro de Düsseldorf</replace>
   </translation>
   <translation initial="M">
      <search>Macbeth</search>
      <counter>1</counter>
      <replace>Macbeth</replace>
   </translation>
   <translation initial="M">
      <search>Madame Bovary</search>
      <counter>1</counter>
      <replace>Madame Bovary</replace>
   </translation>
   <translation initial="M">
      <search>Materialism</search>
      <counter>2</counter>
      <replace>Materialismo</replace>
      <replace>Materialismo</replace>
   </translation>
   <translation initial="M">
      <search>Materialist</search>
      <counter>2</counter>
      <replace>Materialismo</replace>
      <replace>Materialismo</replace>
   </translation>
   <translation initial="M">
      <search>Mathematica</search>
      <counter>1</counter>
      <replace>Mathematica</replace>
   </translation>
   <translation initial="M">
      <search>Midsummer Night's Dream</search>
      <counter>2</counter>
      <replace>El sueño de una noche de verano</replace>
      <replace>El sueño de una noche de verano</replace>
   </translation>
   <translation initial="M">
      <search>Mountaineering</search>
      <counter>1</counter>
      <replace>Montañismo</replace>
   </translation>
   <translation initial="M">
      <search>Mountain climbing</search>
      <counter>1</counter>
      <replace>Montañismo</replace>
   </translation>
   <translation initial="A">
      <search>Alpinism</search>
      <counter>1</counter>
      <replace>Montañismo</replace>
   </translation>
   <translation initial="M">
      <search>Murder on the Orient Express</search>
      <counter>1</counter>
      <replace>Asesinato en el Orient Express</replace>
   </translation>
   <translation initial="M">
      <search>Musketeers</search>
      <counter>1</counter>
      <replace>Los tres mosqueteros</replace>
   </translation>
   <translation initial="M">
      <search>Myocardial infarction</search>
      <counter>2</counter>
      <replace>Infarto</replace>
      <replace>Infarto de miocardio</replace>
   </translation>
   <translation initial="N">
      <search>Name of the Rose</search>
      <counter>1</counter>
      <replace>El nombre de la rosa</replace>
   </translation>
   <translation initial="N">
      <search>Neverending Story</search>
      <counter>1</counter>
      <replace>La historia interminable</replace>
   </translation>
   <translation initial="N">
      <search>Night Watch</search>
      <counter>1</counter>
      <replace>La ronda de noche</replace>
   </translation>
   <translation initial="N">
      <search>Night Watch painting</search>
      <counter>1</counter>
      <replace>La ronda de noche</replace>
   </translation>
   <translation initial="N">
      <search>Night of the Living Dead</search>
      <counter>1</counter>
      <replace>La noche de los muertos vivientes</replace>
   </translation>
   <translation initial="N">
      <search>Nineteen Eighty-Four</search>
      <counter>1</counter>
      <replace>Mil novecientos ochenta y cuatro</replace>
   </translation>
   <translation initial="N">
      <search>Northern Savonia</search>
      <counter>1</counter>
      <replace>Savonia del Norte</replace>
   </translation>
   <translation initial="O">
      <search>Oath of the Horatii</search>
      <counter>2</counter>
      <replace>Juramento de los Horacios</replace>
      <replace>Juramento de los Horacios</replace>
   </translation>
   <translation initial="O">
      <search>Ocean's Eleven</search>
      <counter>2</counter>
      <replace>Cuadrilla de los once</replace>
      <replace>Ocean's Eleven</replace>
   </translation>
   <translation initial="O">
      <search>Oliver Twist</search>
      <counter>1</counter>
      <replace>Oliver Twist</replace>
   </translation>
   <translation initial="O">
      <search>On Her Majesty's Secret Service</search>
      <counter>1</counter>
      <replace>al servicio secreto de su majestad</replace>
   </translation>
   <translation initial="P">
      <search>Parque Central Complex</search>
      <counter>2</counter>
      <replace>Torres de Parque Central</replace>
      <replace>Torres de Parque Central Caracas</replace>
   </translation>
   <translation initial="P">
      <search>Parque San Martin</search>
      <counter>2</counter>
      <replace>Parque General San Martín</replace>
      <replace>Parque General San Martín Mendoza</replace>
   </translation>
   <translation initial="P">
      <search>Persimmon</search>
      <counter>2</counter>
      <replace>Diospyros kaki</replace>
      <replace>Diospyros kaki</replace>
   </translation>
   <translation initial="P">
      <search>Persimmons</search>
      <counter>2</counter>
      <replace>Diospyros kaki</replace>
      <replace>Diospyros kaki</replace>
   </translation>
   <translation initial="P">
      <search>Peter Pan</search>
      <counter>1</counter>
      <replace>Peter Pan</replace>
   </translation>
   <translation initial="P">
      <search>Phantom of the Opera</search>
      <counter>1</counter>
      <replace>El Fantasma de la Ópera</replace>
   </translation>
   <translation initial="P">
      <search>Planet of the Apes</search>
      <counter>1</counter>
      <replace>El planeta de los simios</replace>
   </translation>
   <translation initial="P">
      <search>Pride and Prejudice</search>
      <counter>1</counter>
      <replace>Orgullo y prejuicio</replace>
   </translation>
   <translation initial="Q">
      <search>Quality control</search>
      <counter>2</counter>
      <replace>Control de calidad</replace>
      <replace>Control de calidad</replace>
   </translation>
   <translation initial="Q">
      <search>Quebec city</search>
      <counter>3</counter>
      <replace>Ciudad de Quebec</replace>
      <replace>Ciudad de Quebec</replace>
      <replace>Ciudad de Quebec</replace>
   </translation>
   <translation initial="Q">
      <search>Quirinal</search>
      <counter>1</counter>
      <replace>Quirinal</replace>
   </translation>
   <translation initial="Q">
      <search>Quirinale</search>
      <counter>2</counter>
      <replace>Quirinal</replace>
      <replace>Quirinal</replace>
   </translation>
   <translation initial="Q">
      <search>Québec City</search>
      <counter>4</counter>
      <replace>Ciudad de Quebec</replace>
      <replace>Ciudad de Quebec</replace>
      <replace>Ciudad de Quebec</replace>
      <replace>Ciudad de Quebec</replace>
   </translation>
   <translation initial="R">
      <search>Reductionism</search>
      <counter>2</counter>
      <replace>Reduccionismo</replace>
      <replace>Reduccionismo</replace>
   </translation>
   <translation initial="R">
      <search>Reductionist</search>
      <counter>2</counter>
      <replace>Reduccionismo</replace>
      <replace>Reduccionismo</replace>
   </translation>
   <translation initial="R">
      <search>Reductionistic</search>
      <counter>2</counter>
      <replace>Reduccionismo</replace>
      <replace>Reduccionismo</replace>
   </translation>
   <translation initial="R">
      <search>Roman Holiday</search>
      <counter>1</counter>
      <replace>Vacaciones en Roma</replace>
   </translation>
   <translation initial="R">
      <search>Romeo and Juliet</search>
      <counter>1</counter>
      <replace>Romeo y Julieta</replace>
   </translation>
   <translation initial="S">
      <search>Sense and Sensibility</search>
      <counter>1</counter>
      <replace>Sensatez y sentimientos</replace>
   </translation>
   <translation initial="S">
      <search>Smerdyakov</search>
      <counter>1</counter>
      <replace>Los hermanos Karamazov</replace>
   </translation>
   <translation initial="S">
      <search>Solaris</search>
      <counter>1</counter>
      <replace>Solaris</replace>
   </translation>
   <translation initial="S">
      <search>St Mark's Cathedral</search>
      <counter>2</counter>
      <replace>Basílica de San Marcos</replace>
      <replace>Basílica de San Marcos</replace>
   </translation>
   <translation initial="T">
      <search>The Brothers Karamazov</search>
      <counter>1</counter>
      <replace>Los hermanos Karamazov</replace>
   </translation>
   <translation initial="T">
      <search>The Da Vinci Code</search>
      <counter>1</counter>
      <replace>El código Da Vinci</replace>
   </translation>
   <translation initial="T">
      <search>The Evil Dead</search>
      <counter>1</counter>
      <replace>Posesión infernal</replace>
   </translation>
   <translation initial="T">
      <search>The Exorcist</search>
      <counter>1</counter>
      <replace>El Exorcista</replace>
   </translation>
   <translation initial="T">
      <search>The Fast and the Furious</search>
      <counter>1</counter>
      <replace>The Fast and the Furious</replace>
   </translation>
   <translation initial="T">
      <search>The Fugitive</search>
      <counter>1</counter>
      <replace>El fugitivo</replace>
   </translation>
   <translation initial="T">
      <search>The Great Gatsby</search>
      <counter>1</counter>
      <replace>El gran Gatsby</replace>
   </translation>
   <translation initial="G">
      <search>Gatsby</search>
      <counter>1</counter>
      <replace>El gran Gatsby</replace>
   </translation>
   <translation initial="T">
      <search>The Idiot</search>
      <counter>1</counter>
      <replace>El idiota</replace>
   </translation>
   <translation initial="T">
      <search>The Island</search>
      <counter>1</counter>
      <replace>La isla</replace>
   </translation>
   <translation initial="T">
      <search>The Italian Job</search>
      <counter>1</counter>
      <replace>The Italian Job</replace>
   </translation>
   <translation initial="T">
      <search>The Jazz Singer</search>
      <counter>1</counter>
      <replace>El cantante de jazz</replace>
   </translation>
   <translation initial="T">
      <search>The Leopard</search>
      <counter>1</counter>
      <replace>El gatopardo</replace>
   </translation>
   <translation initial="T">
      <search>The Maltese Falcon</search>
      <counter>1</counter>
      <replace>El halcón maltés</replace>
   </translation>
   <translation initial="T">
      <search>The Mummy</search>
      <counter>1</counter>
      <replace>La Momia</replace>
   </translation>
   <translation initial="T">
      <search>The Name of the Rose</search>
      <counter>1</counter>
      <replace>El nombre de la rosa</replace>
   </translation>
   <translation initial="T">
      <search>The Neverending Story</search>
      <counter>1</counter>
      <replace>La historia interminable</replace>
   </translation>
   <translation initial="T">
      <search>The Old Man and the Sea</search>
      <counter>1</counter>
      <replace>El viejo y el mar</replace>
   </translation>
   <translation initial="T">
      <search>The Phantom of the Opera</search>
      <counter>1</counter>
      <replace>El Fantasma de la Ópera</replace>
   </translation>
   <translation initial="T">
      <search>The Picture of Dorian Gray</search>
      <counter>1</counter>
      <replace>El retrato de Dorian Gray</replace>
   </translation>
   <translation initial="T">
      <search>The Ring</search>
      <counter>1</counter>
      <replace>La señal</replace>
   </translation>
   <translation initial="T">
      <search>The Spy Who Loved Me</search>
      <counter>1</counter>
      <replace>El espía que me amó</replace>
   </translation>
   <translation initial="T">
      <search>The Stranger</search>
      <counter>1</counter>
      <replace>El extranjero</replace>
   </translation>
   <translation initial="T">
      <search>The Ten Commandments</search>
      <counter>1</counter>
      <replace>Los diez mandamientos</replace>
   </translation>
   <translation initial="T">
      <search>The Texas Chainsaw Massacre</search>
      <counter>1</counter>
      <replace>La matanza de Texas</replace>
   </translation>
   <translation initial="T">
      <search>The Three Musketeers</search>
      <counter>1</counter>
      <replace>Los tres mosqueteros</replace>
   </translation>
   <translation initial="T">
      <search>The Trial</search>
      <counter>1</counter>
      <replace>El proceso</replace>
   </translation>
   <translation initial="T">
      <search>The Untouchables</search>
      <counter>1</counter>
      <replace>The Untouchables</replace>
   </translation>
   <translation initial="T">
      <search>Titanic</search>
      <counter>1</counter>
      <replace>Titanic</replace>
   </translation>
   <translation initial="T">
      <search>To Kill a Mockingbird</search>
      <counter>1</counter>
      <replace>Matar un ruiseñor</replace>
   </translation>
   <translation initial="T">
      <search>Treasure Island</search>
      <counter>1</counter>
      <replace>La isla del tesoro</replace>
   </translation>
   <translation initial="U">
      <search>Ulysses</search>
      <counter>1</counter>
      <replace>Ulises</replace>
   </translation>
   <translation initial="U">
      <search>Universalism</search>
      <counter>4</counter>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
   </translation>
   <translation initial="U">
      <search>Universalist</search>
      <counter>4</counter>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
   </translation>
   <translation initial="U">
      <search>Universalists</search>
      <counter>2</counter>
      <replace>Universalismo</replace>
      <replace>Universalismo</replace>
   </translation>
   <translation initial="V">
      <search>Valais</search>
      <counter>2</counter>
      <replace>Cantón del Valais</replace>
      <replace>Cantón del Valais</replace>
   </translation>
   <translation initial="V">
      <search>Valencia</search>
      <counter>4</counter>
      <replace>Comunidad Valenciana</replace>
      <replace>Provincia de Valencia</replace>
      <replace>Reino de Valencia</replace>
      <replace>Valencia</replace>
   </translation>
   <translation initial="V">
      <search>València</search>
      <counter>2</counter>
      <replace>Valencia</replace>
      <replace>Valencia</replace>
   </translation>
   <translation initial="V">
      <search>Vaudevillian</search>
      <counter>2</counter>
      <replace>Vodevil</replace>
      <replace>Vodevil</replace>
   </translation>
   <translation initial="V">
      <search>Vaudevillians</search>
      <counter>2</counter>
      <replace>Vodevil</replace>
      <replace>Vodevil</replace>
   </translation>
   <translation initial="V">
      <search>Volcano</search>
      <counter>2</counter>
      <replace>Volcán</replace>
      <replace>Volcán</replace>
   </translation>
   <translation initial="W">
      <search>War and Peace</search>
      <counter>1</counter>
      <replace>Guerra y paz</replace>
   </translation>
   <translation initial="W">
      <search>War of the Worlds</search>
      <counter>1</counter>
      <replace>La guerra de los mundos</replace>
   </translation>
   <translation initial="W">
      <search>Witness for the Prosecution</search>
      <counter>1</counter>
      <replace>Testigo de cargo</replace>
   </translation>
   <translation initial="W">
      <search>Wuthering Heights</search>
      <counter>1</counter>
      <replace>Cumbres borrascosas</replace>
   </translation>
   <translation initial="X">
      <search>X chromosome</search>
      <counter>2</counter>
      <replace>Cromosoma X</replace>
      <replace>Cromosoma X</replace>
   </translation>
   <translation initial="X">
      <search>Xenophon</search>
      <counter>2</counter>
      <replace>Jenofonte</replace>
      <replace>Jenofonte</replace>
   </translation>
   <translation initial="Y">
      <search>Yacht</search>
      <counter>2</counter>
      <replace>Yate</replace>
      <replace>Yate</replace>
   </translation>
   <translation initial="Y">
      <search>Yakuza</search>
      <counter>2</counter>
      <replace>Yakuza</replace>
      <replace>Yakuza</replace>
   </translation>
   <translation initial="Y">
      <search>You Only Live Twice</search>
      <counter>1</counter>
      <replace>Sólo se vive dos veces</replace>
   </translation>
   <translation initial="Y">
      <search>Yugoslav Macedonia</search>
      <counter>2</counter>
      <replace>República de Macedonia</replace>
      <replace>República de Macedonia</replace>
   </translation>
   <translation initial="Y">
      <search>Yugoslav Partisans</search>
      <counter>2</counter>
      <replace>Partisanos</replace>
      <replace>Partisanos Yugoslavia</replace>
   </translation>
   <translation initial="Z">
      <search>Zespri</search>
      <counter>2</counter>
      <replace>Actinidia deliciosa</replace>
      <replace>Actinidia deliciosa</replace>
   </translation>
   <translation initial="Z">
      <search>Zimniy Dvorets</search>
      <counter>2</counter>
      <replace>Palacio de Invierno</replace>
      <replace>Palacio de Invierno</replace>
   </translation>
   <translation initial="Z">
      <search>Zosimus</search>
      <counter>2</counter>
      <replace>Zósimo</replace>
      <replace>Zósimo historiador</replace>
   </translation>
</Dictionary>

Open in new window

AussieSilverAsked:
Who is Participating?
 
Geert BormansInformation ArchitectCommented:
like this.

Grouping with Muenchian would be a better choice, but since it is sorted and grouped allready...
This has minimum impact on the existing code

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:key name="initial" match="translation" use="@initial"/>
    <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
         method="html" version="4.0" omit-xml-declaration="yes"/>
		 <!--key for uniqueness (Muenchian on the initial attribute) -->
    <xsl:template match="Dictionary">
        <html>
				<head>
                <title> Bilingual Lexicon <xsl:value-of select="/Dictionary/from" />-<xsl:value-of select="/Dictionary/to" /></title>
               
					<link type="text/css" rel="stylesheet" href="dictionary.css" />
                </head>
            <body>
                <h3>Browse by letter</h3>
                <p>
                    <xsl:apply-templates select="translation[generate-id() = generate-id(key('initial', @initial)[1])]" mode="TOC" >
						<!-- Muenchian grouping, used to push out only the nodes with a unique initial attribute  -->
                        <xsl:sort select="@initial" order="ascending" data-type="text"/>
						<!-- The unique nodes for the initials in the TOC will be sorted -->
                    </xsl:apply-templates>
                </p>
                <table >
                    <tr><td width="50%">search</td><th>replace</th></tr>
					<!-- second apply-templates, now inside a table for generating a line for a node, sorted on initial -->
					<!--second apply-templates, now inside a table for generating a line for a node, sorted on initial-->
                    <xsl:apply-templates select="translation" mode="FLOW">
                    <xsl:sort select="@initial" order="ascending" data-type="text"/>
                    </xsl:apply-templates>
                    
                </table>
            </body>
        </html>
    </xsl:template>
	<!-- for unique initial nodes, a link is generated --> 
    <xsl:template match="translation" mode="TOC">
        <a href="{concat('#Dictionary', @initial)}">
            <b><xsl:value-of select="@initial" /></b>
        </a>
        <xsl:text>&#160; </xsl:text>
    </xsl:template>
    <!--for the flow, a table row is generated per translation -->
    <xsl:template match="translation" mode="FLOW">
	<!-- I create a boolean variable that is true if there is no preceding sibling with the same @initial 
		This will be set to true() if t is the first translation with a certain initial
		will be used to put the named anchor for the in-document link -->
        <xsl:variable name="is-first-initial" select="not(preceding-sibling::translation[@initial = current()/@initial])"/>
        <xsl:if test="$is-first-initial">
            <tr>
                <td colspan="2">
                    <b>
                        <xsl:value-of select="@initial"/>
                    </b>
                </td>
            </tr>
        </xsl:if>
        <tr>
            <td>
			<!--named anchor for in-document link-->
                <xsl:if test="$is-first-initial">
                    <a name="{concat('Dictionary', @initial)}"></a>
                </xsl:if>
                <xsl:value-of select="search"/>
            </td>
            <td>
                <xsl:for-each select="replace">
				<!--looping over each replace in the translation, seperating values with ';', unless first-->
                    <xsl:if test="not(position() = 1)">
                        <xsl:text>; </xsl:text>
                    </xsl:if>
                    <xsl:value-of select="."/>
                </xsl:for-each>
            </td>
        </tr>
    </xsl:template>

</xsl:stylesheet>

Open in new window

0
 
AussieSilverAuthor Commented:
works  good :) but how can I put a little space between each letter group? t
0
 
Geert BormansInformation ArchitectCommented:
now, give the table row a class attribute
<tr> becomes <tr class="initial">

and make a change in your CSS
for that specific row you would add a class selector
tr.initial {
tr styling goes here...
}
0
 
AussieSilverAuthor Commented:
Thanks very much my friend ... Will consult you again in 2 weeks


Cheers,
0
 
Geert BormansInformation ArchitectCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.