Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / relaxng / build-to.xml @ 187

History | View | Annotate | Download (3.8 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<project basedir="." default="dist" name="teitohtml">
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-to.xml 9886 2011-12-04 22:50:41Z rahtz $
19
        Copyright: 2011, TEI Consortium<
20
-->
21
  <!--
22
 Convert TEI documents into HTML files.
23
 -->
24
  <!-- Path to TEI XML file. -->
25
  <property name="inputFile" value=""/>
26
  <!-- Path where the output schema file will be saved. -->
27
  <property name="outputFile" value=""/>
28
  <!-- which profile -->
29
  <property name="profile" value="default"/>
30
  <!-- where does oxygen keep stuff -->
31
  <property name="oxygenlib" value=""/>
32
  <!-- Stylesheet for transformation -->
33
  <property name="odd2relax"
34
            value="../profiles/${profile}/relaxng/to.xsl"/>
35
  <property name="odd2oddxsl" value="../odds2/odd2odd.xsl"/>
36
  <dirname property="inputFileDir" file="${inputFile}"/>
37
  <dirname property="outputDir" file="${outputFile}"/>
38
  <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
39
  <path id="classpath">
40
    <pathelement path="${java.class.path}"/>
41
  </path>
42
  <target name="setup">
43
    <delete dir="${outputTempDir}"/>
44
    <mkdir dir="${outputTempDir}"/>
45
  </target>
46
  <target name="odd">
47
    <echo>Do ODD processing</echo>
48
    <xslt force="yes" style="${odd2oddxsl}" in="${inputFile}" out="${outputTempDir}/tmp1.xml" classpath="classpath">
49
      <xmlcatalog>
50
        <catalogpath>
51
          <pathelement location="../../../../catalog.xml"/>
52
          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
53
        </catalogpath>
54
      </xmlcatalog>
55
      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
56
      <classpath location="${oxygenlib}/saxon9ee.jar"/>
57
      <param name="lang" expression="${lang}" if="lang"/>
58
      <param name="defaultSource" expression="${defaultSource}" if="defaultSource"/>
59
      <param name="verbose" expression="${verbose}" if="verbose"/>
60
    </xslt>
61
  </target>
62
  <target name="dist" depends="setup,odd,convert,cleanup"/>
63

    
64
  <target name="convert">
65
    <!-- Recreate temporary output directory -->
66
    <!-- The transformation for HTML output. -->
67
    <echo level="info">XSLT generate RELAXNG files</echo>
68
    <xslt force="yes" style="${odd2relax}" in="${outputTempDir}/tmp1.xml" out="${outputFile}" classpath="classpath">
69
      <xmlcatalog>
70
        <catalogpath>
71
          <pathelement location="../../../../catalog.xml"/>
72
          <pathelement location="../../../../../xhtml11/dtd/xhtmlcatalog.xml"/>
73
        </catalogpath>
74
      </xmlcatalog>
75
      <factory name="net.sf.saxon.TransformerFactoryImpl"/>
76
      <classpath location="${oxygenlib}/saxon9ee.jar"/>
77
      <param name="directory" expression="file:///${outputTempDir}"/>
78
      <!-- supply name of language-->
79
      <param name="lang" expression="${lang}" if="lang"/>
80
      <!-- emit some diagnostics"-->
81
      <param name="debug" expression="${debug}" if="debug"/>
82
      <!-- be verbose-->
83
      <param name="verbose" expression="${verbose}" if="verbose"/>
84
    </xslt>
85
  </target>
86

    
87
  <target name="cleanup" unless="debug">  
88
    <delete dir="${outputTempDir}"/>
89
  </target>
90

    
91
</project>