Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / odt / build-from.xml @ 187

History | View | Annotate | Download (3.2 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<project basedir="." default="dist" name="docxtei">
3
<!--
4
        This library is free software; you can redistribute it and/or
5
        modify it under the terms of the GNU Lesser General Public
6
        License as published by the Free Software Foundation; either
7
        version 2.1 of the License, or (at your option) any later version.
8
        
9
        This library is distributed in the hope that it will be useful,
10
        but WITHOUT ANY WARRANTY; without even the implied warranty of
11
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
        Lesser General Public License for more details.
13
        
14
        You should have received a copy of the GNU Lesser General Public
15
        License along with this library; if not, write to the Free Software
16
        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
        
18
        Id: $Id: build-from.xml 9316 2011-09-13 08:06:05Z rahtz $
19
        Copyright: 2011, TEI Consortium<
20
-->
21
  <!--
22
 Convert odt files to TEI documents.
23
 -->
24
  <!-- Path to ODT file. -->
25
  <property name="inputFile" value=""/>
26
  <!-- Path where the output TEI file will be saved. -->
27
  <property name="outputFile" value=""/>
28
  <!-- which profile -->
29
  <property name="profile" value="default"/>
30
  <!-- which language -->
31
  <property name="lang" value="en"/>
32
  <!-- where does oxygen keep stuff -->
33
  <property name="oxygenlib" value=""/>
34
  <!-- Stylesheet for transformation -->
35
  <property name="odttotei"  value="../profiles/${profile}/odt/from.xsl"/>
36
  <dirname property="inputFileDir" file="${inputFile}"/>
37
  <dirname property="outputDir"    file="${outputFile}"/>
38
  <property name="outputTempDir"   value="${outputDir}/temp-dir-for-ant"/>
39

    
40
  <path id="classpath">
41
    <pathelement path="${java.class.path}"/>
42
  </path>
43

    
44
  <target name="setup">
45
    <!-- Recreate temporary output directory -->
46
    <delete dir="${outputTempDir}"/>
47
    <mkdir  dir="${outputTempDir}"/>
48
  </target>
49

    
50
  <target name="dist" depends="convert,mediadir.check,picturecopy,cleanup"/>
51

    
52
  <target name="convert" depends="setup">
53
    <unzip src="${inputFile}" dest="${outputTempDir}"/>
54
    <xslt force="yes" style="${odttotei}" classpath="classpath" in="${outputTempDir}/content.xml" out="${outputFile}">
55
      <xmlcatalog>
56
        <catalogpath>
57
          <pathelement location="../../../../catalog.xml"/>
58
          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
59
        </catalogpath>
60
      </xmlcatalog>
61
      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
62
      <classpath location="${oxygenlib}/saxon9ee.jar"/>
63
      <param name="dir" expression="${outputTempDir}"/>
64
      <param name="inputDir" expression="${inputFileDir}"/>
65
      <param name="mediaDir" expression="Pictures"/>
66
    </xslt>
67
  </target>
68

    
69
  <target name="mediadir.check">
70
    <condition property="mediadir.exists">
71
      <available file="${outputTempDir}/Pictures" type="dir"/>
72
    </condition>
73
  </target>
74

    
75
  <target name="picturecopy" if="${mediadir.exists}">
76
    <move todir="${outputDir}/Pictures"  overwrite="true">
77
      <fileset dir="${outputTempDir}/Pictures"/>
78
    </move>
79
  </target>
80

    
81
  <target name="cleanup" unless="debug">
82
    <delete dir="${outputTempDir}"/>
83
  </target>
84

    
85
</project>