Ajouter la version sans modèles
This commit is contained in:
parent
3610bd08f4
commit
a1a6b813dc
@ -27,7 +27,7 @@
|
||||
exclude-result-prefixes="office table text">
|
||||
<!-- Namespaces needed to access parts of the document -->
|
||||
|
||||
<!-- Version 0.94: Add a SYSTEM DOCTYPE to output -->
|
||||
<!-- Version 0.93: Add a SYSTEM DOCTYPE to output -->
|
||||
<xsl:output method = "xml" indent = "yes" encoding = "UTF-8"
|
||||
doctype-system="tmx14.dtd" omit-xml-declaration = "no"/>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
<header>
|
||||
<xsl:attribute name="creationtool">TMX-export for LibreOffice</xsl:attribute>
|
||||
<xsl:attribute name="creationtoolversion">0.94</xsl:attribute>
|
||||
<xsl:attribute name="creationtoolversion">0.95</xsl:attribute>
|
||||
<xsl:attribute name="segtype">sentence</xsl:attribute>
|
||||
<xsl:attribute name="o-tmf">application/vnd.oasis.opendocument.spreadsheet</xsl:attribute>
|
||||
<xsl:attribute name="adminlang">
|
||||
@ -64,34 +64,10 @@
|
||||
<xsl:attribute name="datatype">plaintext</xsl:attribute>
|
||||
</header>
|
||||
|
||||
<!-- Define the TMX body
|
||||
Additional templates are called to make the code
|
||||
easier to modify and maintain. -->
|
||||
<!-- Define the TMX body. -->
|
||||
<body>
|
||||
<!-- Call the template to insert <tu> elements -->
|
||||
<xsl:apply-templates select="//table:table"/>
|
||||
</body>
|
||||
</tmx>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Templates to populate the <tu> and <tuv> elements-->
|
||||
|
||||
<!-- Template for <tu> elements:
|
||||
Loop through each row, skipping the first one. -->
|
||||
<xsl:template match="table:table">
|
||||
<xsl:for-each select="table:table-row">
|
||||
<xsl:for-each select="//table:table-row[position()>1]">
|
||||
<tu>
|
||||
<xsl:apply-templates select="//table:table-row[position()>1]"/>
|
||||
</tu>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Template for the <tuv> elements:
|
||||
Loop through each cell in the row, and assign the value
|
||||
of the language for that column to the xml:lang attribute.
|
||||
After that, add the <seg> element and populated it with the
|
||||
text in the current cell. -->
|
||||
<xsl:template match="table:table-row[position()>1]">
|
||||
<xsl:for-each select="table:table-cell">
|
||||
<xsl:variable name="currentLang"
|
||||
select="//table:table/table:table-row[1]/table:table-cell"/>
|
||||
@ -108,6 +84,10 @@
|
||||
</tuv>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</tu>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</tmx>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
Reference in New Issue
Block a user