I would like to align multiple translations of a TEI-encoded text and tranform it via xslt into html.
The xml (adapted from https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-linkGrp.html) looks like this:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="mini.xsl"?>
<TEI>
<linkGrp type="translation">
<link target="#CCS1 #SW1"/>
<link target="#CCS2 #SW2"/>
<link target="#CCS #SW"/>
</linkGrp>
<div type="volume" xml:id="CCS"
xml:lang="fr">
<p>
<s xml:id="CCS1">Longtemps, je me suis couché de bonne heure.</s>
<s xml:id="CCS2">Parfois, à peine ma bougie éteinte, mes yeux se fermaient si vite que je n'avais pas le temps de me dire : "Je m'endors."</s>
</p>
<!-- ... -->
</div>
<div type="volume" xml:id="SW" xml:lang="en">
<p>
<s xml:id="SW1">For a long time I used to go to bed early.</s>
<s xml:id="SW2">Sometimes, when I had put out my candle, my eyes would close so quickly that I had not even time to say "I'm going to sleep."</s>
</p>
<!-- ... -->
</div>
</TEI>
The linkGrp
element contains the alignment info. I would like to select the s-element within the div-elements according according to this alignment info.
With the following xsl file I can output the attribute values themselves, but I have no idea how to grap and output the corresponding lines:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="TEI/linkGrp">
<xsl:apply-templates select="link"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="link">
<xsl:value-of select="@target"/>
</xsl:template>
</xsl:stylesheet>
What I am trying to get is a simple html-table that has #CCS-lines on one side and the #SW on the other, that is:
<table>
<tr>
<td>Longtemps, je me suis couché de bonne heure.</td>
<td>For a long time I used to go to bed early.</td>
</tr>
<tr>
<td>Parfois, à peine ma bougie éteinte, mes yeux se fermaient si vite que je n'avais pas le temps de me dire : "Je m'endors."</td>
<td>Sometimes, when I had put out my candle, my eyes would close so quickly that I had not even time to say "I'm going to sleep."</td>
</tr>
</table>
Any help will be appreciated!