mindmapping_to_hdoc.ant 2.42 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
Bastien FREMONDIERE's avatar
Bastien FREMONDIERE committed
2
<project basedir="." default="default" >
3 4 5 6 7 8 9 10 11 12 13 14 15 16
    <property name="module" value="default"/>
    <!--
	only for the debug
	<property name="inputPath" value="test.mm"></property>
    	<property name="outputPath"	value="content.xml"/>
	<property name="converting"	value="yes"/> 
    -->

    <property name="resultFile" value="${basedir}/result"/>
    
    <target name="default" depends="preparation">
        <echo>----------------------------Begin of conversion----------------------------------</echo>


aperdria's avatar
aperdria committed
17
  	<!-- Sect Schema : only sect element -->
18 19 20 21 22
        <antcall target="Makehdoc">
            <param name="myXSLT" value="sect.xsl"/>
            <param name="hdocName" value="sect"/>
        </antcall>

23
      	<!-- For debug purposes <delete dir="${basedir}/temp"/> -->
24 25 26 27 28 29 30 31 32
        <echo>----------------------------End of conversion----------------------------------</echo>
    </target>
    
    <target name="preparation">
        <echo>Setting up the conversion</echo>
        <delete dir="${basedir}/temp"></delete>
        <mkdir dir="${basedir}/temp" />
        <delete dir="${resultFile}/hdoc"></delete>
        <mkdir dir="${resultFile}/hdoc" />
33 34 35
        <!--<condition>
          <equals arg1="${foo}" arg2=""/>
        </condition> -->
36 37 38 39 40 41 42 43 44 45 46
        <!-- //delete temp -->  
        <echo>--- End ----</echo>
    </target>
    
   <!-- Convert a mindMap file into a hdoc, with a xsl schema specified in the parameter -->
   <target name="Makehdoc" >
       <echo>Begin data conversion</echo>
       <mkdir dir="${basedir}/temp/${hdocName}"/>
       <mkdir dir="${basedir}/temp/${hdocName}/META-INF"/>
       <copy file="${basedir}/mimetype" tofile="${basedir}/temp/${hdocName}/mimetype"/>
       <!-- create the container file with an XSLT transformation -->
Bastien FREMONDIERE's avatar
Bastien FREMONDIERE committed
47
       <xslt classpath="lib/saxon9he.jar" in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/META-INF/container.xml" xslresource="${basedir}/xslt/makeContainer.xsl"/>
48
	     <!-- create the file which contains the freemind data converted-->
Bastien FREMONDIERE's avatar
Bastien FREMONDIERE committed
49
       <xslt classpath="lib/saxon9he.jar" in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/content.xml" xslresource="${basedir}/xslt/${myXSLT}"/>
50
       
51
	     <!-- zipping files as the hdoc format -->
52 53 54 55 56 57 58 59
       <zip destfile="${resultFile}/hdoc/${hdocName}.hdoc"
       basedir="${basedir}/temp/${hdocName}"/>
    <!-- </condition> -->
       
       <echo>end data conversion</echo>
   </target>
    
</project>