Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
1138f0cb
Commit
1138f0cb
authored
Jan 03, 2016
by
Hachem Rihab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hdoc_to_optim] fix saxon import and changed to if/else
parent
af78d304
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
72 deletions
+75
-72
hdoc_to_optim/hdoc_to_optim.ant
hdoc_to_optim/hdoc_to_optim.ant
+72
-71
hdoc_to_optim/xsl/find_content.xsl
hdoc_to_optim/xsl/find_content.xsl
+3
-1
No files found.
hdoc_to_optim/hdoc_to_optim.ant
View file @
1138f0cb
<project name="hdoc_to_optim" default="convert">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib.jar" />
</classpath>
</taskdef>
<!-- Arguments properties -->
<property name="DocType" value="none" />
<property name="InputFile" value="none" />
<property name="InputPath" value="input" />
<property name="OutputPath" value="output" />
<property name="OutputScarPath" value="${OutputPath}/result.scar" />
<target name="convert" depends="-condition, -noinput, -input"></target>
<property name="OutputScarPath" value="${OutputPath}/result.scar" />
<!--Check wether there is an input using command line or not-->
<target name="-condition">
<condition property="do.noinput">
<equals arg1="${InputFile}" arg2="none" />
</condition>
<condition property="do.input">
<not>
<equals arg1="${InputFile}" arg2="none" />
</not>
</condition>
</target>
<!--There is no input, check the input folder-->
<target name="-noinput" if="do.noinput">
<echo message="The value of property InputFile is none... Checking the input folder" />
<!-- get input hdoc file path -->
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocFile" pathsep="" refid="fileset_hdoc" />
<target name="convert">
<!--Check wether there is an input using command line or not-->
<if>
<equals arg1="${InputFile}" arg2="none" />
<then>
<!--There is no input, check the input folder-->
<echo message="The value of property InputFile is ${InputFile} ... Checking the input folder" />
<!-- get input hdoc file path -->
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocFile" pathsep="" refid="fileset_hdoc" />
<echo message="Executing conversion..." />
<echo message="Executing conversion..." />
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${HdocFile}"/>
<!--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="xsl/find_content.xsl"/>
<chmod file="get_content.ant" perm="777"/>
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${HdocFile}"/>
<!--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="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-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputScarPath}" encoding="UTF-8"/>
<!--temporary files and folders are deleted-->
<!--<delete dir="hdoc"/>
<delete dir="result"/>-->
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</target>
<!--There is an input-->
<target name="-input" if="do.input">
<echo message="The value of property InputFile is ${InputFile}" />
<!--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="${OutputScarPath}" encoding="UTF-8"/>
<!--temporary files and folders are deleted-->
<!--<delete dir="hdoc"/>
<delete dir="result"/>-->
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</then>
<else>
<!--There is an input-->
<echo message="The value of property InputFile is ${InputFile}" />
<echo message="Executing conversion..." />
<echo message="Executing conversion..." />
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputFile}"/>
<!--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="xsl/find_content.xsl"/>
<chmod file="get_content.ant" perm="777"/>
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputFile}"/>
<!--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="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-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputScarPath}" encoding="UTF-8"/>
<!--temporary files and folders are deleted-->
<!--<delete dir="hdoc"/>
<delete dir="result"/>-->
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</target>
<!--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="${OutputScarPath}" encoding="UTF-8"/>
<!--temporary files and folders are deleted-->
<!--<delete dir="hdoc"/>
<delete dir="result"/>-->
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</else>
</if>
</target>
</project>
\ No newline at end of file
hdoc_to_optim/xsl/find_content.xsl
View file @
1138f0cb
...
...
@@ -28,6 +28,8 @@
<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=
"xsl/transfo.xsl"
/>
<xslt
in=
"hdoc/{$path}"
out=
"result/content.paper"
style=
"xsl/transfo.xsl"
classpath=
"lib/saxon9he.jar"
>
<factory
name=
"net.sf.saxon.TransformerFactoryImpl"
/>
</xslt>
</xsl:template>
</xsl:stylesheet>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment