Commit 8c6b7614 authored by Ivan D'halluin's avatar Ivan D'halluin
Browse files

Merge branch 'master' of

parents 5232ad43 cfc28ca4
# Hdoc Converter Projet
License GPL3.0
Credits : Université de Technologie de Compiègne, NF29 course students
## What is Hdoc ?
......@@ -10,4 +15,11 @@ Please refer to the [Hdoc converter project website](
## What is this repository ?
This repository gathers some of the Hdoc converters, if not all of them.
\ No newline at end of file
This repository gathers some of the Hdoc converters, if not all of them.
Project URL :
## How to use Hdoc Converters ?
In order to use a converter, choose the corresponding folder and consult for instructions.
# antce
"antce" is not for use, it is just a base for autonomous multi-OS ANT launcher
......@@ -55,7 +55,7 @@
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRdf.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".rdf">
<include name="**/*.term"/>
<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
......@@ -71,4 +71,4 @@
<delete dir="${outdir}" />
\ No newline at end of file
......@@ -4,11 +4,9 @@
exclude-result-prefixes="xs sp sc lx"
<xsl:output method="xml" indent="yes" />
......@@ -198,6 +198,11 @@
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<delete dir="${optim_to_hdoc_in}" failonerror="false"/>
<mkdir dir="${optim_to_hdoc_in}"/>
<delete dir="${hdoc_to_opale_in}" failonerror="false"/>
<mkdir dir="${hdoc_to_opale_in}"/>
\ No newline at end of file
Optim to Opale (optim_to_opale)
Optim to Opale (`optim_to_opale`)
Last edit: January 4, 2016
Last edit: December 17, 2015
This project is under [GPL 3.0 licence](
# Purpose
### Autumn 2015
`optim_to_opale` is an ANT script to convert a file from Optim format to Opale format.
* Jean-Baptiste MARTIN
# Dependencies
`optim_to_opale` is an ANT script that converts a file from Optim format to Opale format. It simply calls `optim_to_hdoc`and `hdoc_to_opale`scripts.
In order to work properly this script needs
1. `optim_to_hdoc` (Optim to HDoc conversion)
2. `hdoc_to_opale` (HDoc to Opale conversion)
1. [`optim_to_hdoc`]( (Optim to HDoc conversion)
2. [`hdoc_to_opale`]( (HDoc to Opale conversion)
# Running the script
User Documentation
### Running the script
1. Put the file you want to convert into the `input` directory
2. Run the ``file on a Unix system (Linux, Mac OS, etc.) or the `run.bat`on Windows
3. Your converted file is placed into the `output` directory (a log file is also placed into the `log`directory)
4. Enjoy!
# How is this script working
### How is this script working
1. The script first determines what OS you are using so it then can call the right scripts
2. It cleans the `log`, `tmp`and `output`directories
......@@ -32,3 +45,21 @@ In order to work properly this script needs
7. It copies the files that are inside the `output`directory of `hdoc_to_opale` to the `output` directory of `optim_to_opale`
During all the process it also prints some basic information both on screen and in the log file.
* The script currently doesn't support any paramater to specify the file to convert. If multiple files are in the `input`directory, the script will convert all these files.
Known bugs
N/A for now.
Technical notes
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
<!-- This XSL create an ANT script that will download our ressources (images) using the GET TASK-->
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:param name="dest-rep">${hdocResultPath}/ressources</xsl:param>
<project name="getRessourcesFiles" basedir="." default="getRessourcesFiles">
<!-- Ccreation of the ressources folder -->
<mkdir dir="{$dest-rep}"/>
<target name="getRessourcesFiles">
<xsl:apply-templates select="//div[@class='thumb tleft' or @class='thumb tright']//img | //p//img | //center//img | //li//img"/>
<!-- If an image doesn't appear in final result you should add it to the apply-template above-->
<!-- What has been changed starts from here -->
<xsl:template match="img" priority="5">
<!-- Now the storage structure of the images will become :
image.jpeg (this is a folder)
<!-- The meta.xml contains the copyright file of the image -->
<!-- The meta.xml should respect the structure given to you in official-meta.xml (it's available in the same level as this file) )-->
<xsl:param name="dest-rep-image">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/></xsl:param>
<xsl:param name="dest-file">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>
<xsl:param name="dest-file-meta">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/>/meta.xml</xsl:param>
<xsl:param name="copyright-link"><xsl:value-of select="following-sibling::a[1]/@href"/></xsl:param>
<mkdir dir="{$dest-rep-image}"/>
<get src="{@src}" dest="{$dest-file}" /><!-- Get The image -->
<!-- Get the copyright file of the image if it existt -->
<xsl:if test="$copyright-link !=''" >
<get src="{$copyright-link}" dest="{$dest-file-meta}" />
<!-- Here You should generate Your XSL transformation to extract the right information from the copyright file (final result should be similar as official-meta.xml)
Very Important, The title of the image is not present in the copyright file BUT We have prepared it already in the @alt attribute
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:jpg_jpeg xmlns:op="" xmlns:sc="" xmlns:sfm="">
<op:imgM xmlns:sp="">
<sp:title>Principal title</sp:title>
<sp:altTxt>remplacement text</sp:altTxt>
<sc:para xml:space="preserve">Complete description</sc:para>
\ No newline at end of file
Supports Markdown
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