TEI2TMX.xsl

Introduction
This is a stylesheet to convert P5 TEI parallel-text documents to TMX (Translation Memory eXchange) files. It assumes that div-level tags are linked with @corresp attributes to their translation in another language. The script has only been tested with bi-lingual documents and I have no reason to believe that it'll work with documents with more than two languages.

Stylesheet
  

             <tuv xml:lang="{$remote/@xml:lang}"> <xsl:apply-templates select="$remote/*|$remote/text" mode="inner"/> </tu> </xsl:template>

 <xsl:text> </xsl:text> </xsl:template>  <xsl:value-of select="."/> </xsl:template>  </xsl:template>  <xsl:text> </xsl:text> <xsl:apply-templates select="* | text" mode="inner"/> <xsl:text> </xsl:text> </xsl:template>

 <xsl:apply-templates select="*"/> </xsl:template> </xsl:stylesheet>