Commit cb36f02c authored by Hachem Rihab's avatar Hachem Rihab

re-arranged code to make run.bat work (put source in an input folder)

parent 1bbc0452
<project name="hdoc_to_optim" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="input" />
<property name="OutputPath" value="output" />
<property name="OutputScarPath" value="${OutputPath}/result.scar" />
<target name="convert">
<!-- get input hdoc file path -->
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocPath" pathsep="" refid="fileset_hdoc" />
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputPath}"/>
<!--gives all rights to avoid bugs-->
<unzip dest="hdoc" src ="${HdocPath}"/>
<!--gives all rights to avoid bugs-->
<chmod dir="hdoc" perm="777"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="find_content.xsl"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="xsl/find_content.xsl"/>
<chmod file="get_content.ant" perm="777"/>
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputPath}"/>
<!--temporary files and folders are deleted-->
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputScarPath}"/>
<!--temporary files and folders are deleted-->
<delete dir="hdoc"/>
<delete dir="result"/>
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=myantce.ant
set ant=hdoc_to_optim.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
......
#!/bin/sh
lib="lib"
ant="myantce.ant"
ant="hdoc_to_optim.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
......
......@@ -4,14 +4,14 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:param name="destfile" required="yes" as="xs:string"/>
<!--<xsl:param name="destfile" required="yes" as="xs:string"/>-->
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:container">
<project name="hdoc_to_optim" default="main">
<target name="main">
<mkdir dir="result"/>
<chmod dir="result" perm="777"/>
<copy file=".wspmeta" todir="result"/>
<copy file="output/.wspmeta" todir="result"/>
<xsl:apply-templates/>
</target>
</project>
......@@ -24,10 +24,10 @@
<xsl:template match="h:rootfile">
<xsl:variable name="path" select="@full-path"/>
<!--the ANT runs the XSLT get_ressources then the ANT created by it-->
<xslt in="hdoc/{$path}" out="get_ressources.ant" style="find_ressources.xsl"/>
<xslt in="hdoc/{$path}" out="get_ressources.ant" style="xsl/find_ressources.xsl"/>
<chmod file="get_ressources.ant" perm="777"/>
<ant antfile="get_ressources.ant"/>
<!--the ANT runs the main XSLT transfo-->
<xslt in="hdoc/{$path}" out="result/content.paper" style="transfo.xsl"/>
<xslt in="hdoc/{$path}" out="result/content.paper" style="xsl/transfo.xsl"/>
</xsl:template>
</xsl:stylesheet>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment