Skip to content

Commit

Permalink
Fix ODS export.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-jung committed Jan 8, 2025
1 parent cc62fb7 commit 9d5b83f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ant/build_ods-export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
================================================================================
-->
<property environment="env"/>
<property name="debugging.mode" value="false"/>
<property name="debugging.mode" value="true"/>
<condition property="dbg">
<equals arg1="${debugging.mode}" arg2="true"/>
</condition>
Expand All @@ -49,6 +49,7 @@
-->
<target name="ods-export" depends="-temp.dir">
<fail unless="termmap" message="The mandatory property 'termmap' is not set."/>
<fail unless="language" message="The mandatory property 'language' is not set."/>

<!-- Subdirectory in the temporary directory of the terminology plugin. -->
<property name="ods-export.temp.dir" value="${jung.terminology.temp.dir}${file.separator}ods-export"/>
Expand All @@ -75,7 +76,7 @@
style="../xsl/ods-export/ods-export.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<classpath refid="saxon"/>
<param name="language" expression="de-DE"/>
<param name="language" expression="${language}"/>
</xslt>
<echo if:true="${debugging.mode}" message="+ [DEBUG] Transform terminology to '${ods-export.temp.dir}${file.separator}ods.xml'"/>

Expand Down
6 changes: 3 additions & 3 deletions xsl/ods-export/ods-export.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<xsl:import href="ods-root.xsl"/>

<!-- Language to be exported. Unless set, all languages are exported. -->
<xsl:param name="language" as="xs:string" select="'de-DE'"/>
<xsl:param name="language" as="xs:string" select="'all'"/>

<xsl:template match="*[(self::termref) and @href]">
<xsl:variable name="docPath" select="resolve-uri(@href, base-uri())"/>
Expand All @@ -47,10 +47,10 @@
<text:p>{ancestor::termentry/title/text()}</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" table:style-name="ce1">
<text:p>{ancestor::termentry/definition/defintionText/text()}</text:p>
<text:p>{ancestor::termentry/definition/definitionText/text()}</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" table:style-name="ce1">
<text:p>{ancestor::termentry/definition/defintionSource/text()}</text:p>
<text:p>{ancestor::termentry/definition/definitionSource/text()}</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" table:style-name="ce1">
<text:p>{@language}</text:p>
Expand Down
3 changes: 3 additions & 0 deletions xsl/ods-export/ods-root.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
exclude-result-prefixes="xs math">

<xsl:param name="language" as="xs:string"/>

<xsl:template match="/">
<xsl:message select="'+ [DEBUG] language = ''' || $language || ''''"/>
<office:document-content xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down

0 comments on commit 9d5b83f

Please sign in to comment.