Commit 09ae0b78 authored by qaomia's avatar qaomia

Merge branch 'master' of https://gitlab.utc.fr/crozatst/hdoc

parents b75a7046 d79d96cc
......@@ -6,20 +6,16 @@ http://www.gnu.org/licenses/gpl-3.0.txt
Credits : Université de Technologie de Compiègne, NF29 course students
## What is Hdoc ?
Please refer to the [Hdoc converter project website](http://hdoc.crzt.fr/www/co/hdocConverter.html)
Please refer to the [Hdoc converter project website](http://hdoc.crzt.fr)
>The aim of the project is to propose:
>- a generic XML schema based on XHTML5 for documentary purpose (Hdoc format);
>- a set of converters to transform document formats from and to Hdoc;
>- a web site to manage the converters (Hdoc Converter Portal).
## What is this repository ?
This repository gathers some of the Hdoc converters, if not all of them.
Project URL : https://gitlab.utc.fr/crozatst/hdoc.git
## How to use Hdoc Converters ?
In order to use a converter, choose the corresponding folder and consult README.md for instructions.
......@@ -18,6 +18,7 @@ User documentation
------------------
Use the project as describe in the root README. You can convert multiple files by putting all `.scar` in the input folder.
You can convert paper, section, website, slideshow and webpage.
Known bugs
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0"
xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon"
>
<!-- 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-->
</target>
</project>
</xsl:template>
<!-- What has been changed starts from here -->
<xsl:template match="img" priority="5">
<!-- Now the storage structure of the images will become :
ressources
image.jpeg (this is a folder)
image.jpeg
meta.xml
-->
<!-- 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>
<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
-->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sfm:jpg_jpeg xmlns:op="utc.fr:ics/opale3" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta">
<op:imgM xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:title>Principal title</sp:title>
<sp:info>
<op:infoBin>
<sp:cc>zero</sp:cc>
<sp:ccVersion>2.5</sp:ccVersion>
</op:infoBin>
</sp:info>
<sp:alt>
<sp:type>info</sp:type>
<sp:altTxt>remplacement text</sp:altTxt>
<sp:desc>
<op:sTxt>
<sc:para xml:space="preserve">Complete description</sc:para>
</op:sTxt>
</sp:desc>
</sp:alt>
</op:imgM>
</sfm:jpg_jpeg>
\ No newline at end of file
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