mindmapping_to_hdoc.ant 2.2 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
	<property name="module" value="default"/>
	<!--
5 6
	only for the debug
	<property name="inputPath" value="test.mm"></property>
7
	<property name="outputPath"	value="content.xml"/>
8
	<property name="converting"	value="yes"/> 
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
	-->
	
	<property name="resultFile" value="${basedir}/result"/>
	
	<target name="default" depends="preparation">
		<echo>----------------------------Begin of conversion----------------------------------</echo>
		
		
		<!-- Sect Schema : only sect element -->
		<antcall target="Makehdoc">
			<param name="myXSLT" value="sect.xsl"/>
			<param name="hdocName" value="sect"/>
		</antcall>
		
		<!-- For debug purposes <delete dir="${basedir}/temp"/> -->
		<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" />
		<!--<condition>
			<equals arg1="${foo}" arg2=""/>
			</condition> -->
		<!-- //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 -->
		<xslt classpath="lib/saxon9he.jar" in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/META-INF/container.xml" xslresource="${basedir}/xslt/makeContainer.xsl"/>
		<!-- create the file which contains the freemind data converted-->
		<xslt classpath="lib/saxon9he.jar" in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/content.xml" xslresource="${basedir}/xslt/${myXSLT}"/>
		
		<!-- zipping files as the hdoc format -->
		<zip destfile="${resultFile}/hdoc/${hdocName}.hdoc"
		basedir="${basedir}/temp/${hdocName}"/>
		<!-- </condition> -->
		
		<echo>end data conversion</echo>
	</target>
58 59

</project>