<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<!--Word-for-word interlinearization, i.e. word-level interlinearization (N.B.: requires corresponding document structure done out by you the linguist or some clever separate (semi-) automated  process...not, unfortunately, automatic itself.-->


<xsl:template match="/">
<html>
<head>
<xsl:for-each select="collection">
<title><xsl:value-of select="title"/></title>
</xsl:for-each>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<font face="Arial Unicode MS, Gentium, Lucida Grande">
<xsl:for-each select="collection">
<h2><xsl:value-of select="title"/></h2>
</xsl:for-each>
<p></p>
<xsl:for-each select="collection/text">
<table border="0">
<tr bgcolor="salmon">
<th align="left" colspan="2"><xsl:value-of select="title"/></th>
</tr>
<tr>
<td colspan="2">
<!--still need to clean things up so that a skinny empty tr isn't created for all the stories that have no soundfile, as it stands now; and I want to keep the empty soundfile element in the original data xml; deleting it is a cheap and dangerous way out
-->
<xsl:for-each select="soundfile">
<embed src="{.}.wav" autostart="no" height="12"></embed>
</xsl:for-each>
</td>
</tr>

<tr>
<td colspan="2"><p></p></td>
</tr>


<xsl:for-each select="line">

<tr>
<td colspan="2">
<!--begin interlinearization chunk, which is a whole table nested inside a cell in a row in the larger table -->
<xsl:for-each select="interlinearization">
<table border="0">
<tr>
<xsl:for-each select="wordgloss">
<td width="300">
<font face="Lucida Grande" color="maroon">
<xsl:value-of select="wordglossPB"/>
</font>
</td>
</xsl:for-each>
</tr>
<tr>
<xsl:for-each select="wordgloss">
<td width="300"><i><xsl:value-of select="wordglossEG"/></i></td>
</xsl:for-each>
</tr>
</table>
</xsl:for-each>
<!--end interlinearization chunk, which is a whole table nested inside a cell in a row in the larger table -->
</td>
</tr>

<tr>
<td><font color="purple"><i><xsl:value-of select="eg"/></i></font></td>
</tr>


<tr>
<td colspan="2"><p></p></td>
</tr>

<tr>
<td colspan="2"><p></p></td>
</tr>


<!--alternative for the spacing line:

 <tr>
<td><p></p></td>
<td><p></p></td>
</tr>


-->
</xsl:for-each>
</table>
<br></br>
<br></br>
<br></br>
</xsl:for-each>
</font>
</body>
</html>
</xsl:template>
</xsl:stylesheet>