Statistics
| Revision:

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

History | View | Annotate | Download (3.1 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<project basedir="." default="dist" name="teitornc">
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 9316 2011-09-13 08:06:05Z rahtz $
19
        Copyright: 2011, TEI Consortium<
20
    -->
21
    <!--
22
        Convert TEI documents into RNC schemas.
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
    <dirname property="inputFileDir" file="${inputFile}"/>
33
    <dirname property="outputDir" file="${outputFile}"/>
34
    <property name="outputTempDir" value="${outputDir}/temp-dir-for-ant"/>
35
    <!-- The input file for the TRANG transformation. -->
36
    <property name="trangInputFile" value="${outputFile}.rng"/>
37
    
38
    <path id="classpath">
39
        <pathelement path="${java.class.path}"/>
40
    </path>
41
    
42
    <!-- Use the Relax NG target to obtain a Relax NG schema and afterward transform it
43
        to RNC using TRANG. -->
44
    <target name="trangConvert">
45
        <!-- Obtain a Relax NG schema.  -->
46
        <ant antfile="../relaxng/build-to.xml" dir="../relaxng"/>
47
        <!-- The Relax NG was generated inside the output file. -->
48
        <copy file="${outputFile}" tofile="${trangInputFile}"/>
49
        
50
        <echo level="info">TRANG generate RNC from RELAXNG files</echo>
51
        <java classname="com.thaiopensource.relaxng.translate.Driver" fork="no">
52
            <classpath>
53
                <path refid="classpath"/>
54
                <pathelement location="${oxygenlib}/trang.jar"/>
55
            </classpath>
56
            <!-- Even though the output type is inferred from the output file extension,
57
                make sure it's the right one. -->
58
            <arg value="-O"/>
59
            <arg value="rnc"/>
60
            <arg value="${trangInputFile}" />
61
            <arg value="${outputFile}" />
62
        </java>
63
    </target>
64
    
65
    <target name="cleanup" unless="debug">
66
        <!-- Delete the intermediate Relax NG schema. -->
67
        <delete file="${trangInputFile}"/>
68
    </target>
69
    
70
    <target name="dist" depends="trangConvert, cleanup"/>
71
    
72
</project>