-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
41 lines (37 loc) · 1.76 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="pdf2tei" default="default">
<target name="initial">
<!-- create a directory for the processing results within ${outDir} -->
<pathconvert property="targetDir">
<path id="ttargetDir">
<pathelement location="${outDir}/${name}" />
</path>
</pathconvert>
<mkdir dir="${targetDir}/temp" />
<exec executable="pdftohtml">
<arg value="-xml" />
<arg value="${pdf}" />
<arg value="${targetDir}/temp.xml" />
</exec>
</target>
<target name="default" depends="initial">
<tempfile property="xml1" suffix="-1.xml" destdir="${targetDir}/temp"/>
<tempfile property="xml2" suffix="-2.xml" destdir="${targetDir}/temp"/>
<tempfile property="xml3" suffix="-3.xml" destdir="${targetDir}/temp"/>
<tempfile property="xml4" suffix="-4.xml" destdir="${targetDir}/temp"/>
<tempfile property="xml5" suffix="-5.xml" destdir="${targetDir}/temp"/>
<copy file="${targetDir}/temp.xml" tofile="${targetDir}/temp/temp.xml">
<filterchain>
<linecontains negate="true">
<contains value="pdf2xml.dtd"/>
</linecontains>
</filterchain>
</copy>
<xslt in="${targetDir}/temp/temp.xml" style="pt0.xsl" out="${xml1}" classpath="${saxon}" />
<xslt in="${xml1}" style="pt1.xsl" out="${xml2}" classpath="${saxon}" />
<xslt in="${xml2}" style="pt2.xsl" out="${xml3}" classpath="${saxon}" />
<xslt in="${xml3}" style="pt3.xsl" out="${xml4}" classpath="${saxon}" />
<xslt in="${xml4}" style="pt4.xsl" out="${xml5}" classpath="${saxon}" />
<xslt in="${xml5}" style="pt5.xsl" out="${targetDir}/${name}.xml" classpath="${saxon}" />
</target>
</project>