Commit 21084fe0 authored by Bastien FREMONDIERE's avatar Bastien FREMONDIERE
Browse files

Merge branch 'master' into mindmapping

parents eb287fa3 2c09fc3a
<?xml version="1.0" encoding="UTF-8" ?>
<wspType defaultCode="OptimOffice" title="OptimOffice 1.2 (fr-FR)" description="" uri="OptimOffice1-2_fr-FR_006" key="OptimOffice1-2" lang="fr-FR" version="1.2.006"><wspUpdate localAutoUpdate="minor"><res key="OptimOffice1-2.wsp"/></wspUpdate><systemSpace space="~param/OptimOffice1-2/ss"><res key="OptimOffice1-2.ss"/></systemSpace><systemSpace space="~param/OptimOffice1-2/bs" optional="true"><res key="OptimOffice1-2.bs"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/paperRpt"><res key="OptimOffice1-2.gen.paperRpt"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/paperLight"><res key="OptimOffice1-2.gen.paperLight"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldHtml"><res key="OptimOffice1-2.gen.sldHtml"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/site"><res key="OptimOffice1-2.gen.site"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldRptR"><res key="OptimOffice1-2.gen.sldRptR"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldRptS"><res key="OptimOffice1-2.gen.sldRptS"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/preSite"><res key="OptimOffice1-2.gen.preSite"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/control"><res key="OptimOffice1-2.gen.control"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/preSldHtml"><res key="OptimOffice1-2.gen.preSldHtml"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/ftp"><res key="OptimOffice1-2.gen.ftp"/></systemSpace><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldRptR"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldRptR/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldRptS"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldRptS/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_page.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_folder.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><editionSheet pack="OptimOffice1-2_fr-FR_006" brickSelector="{OptimOffice1-2.moz;1.2.006;fr-FR}"/></wspType>
\ No newline at end of file
@echo off
set lib=lib
set ant=myantce.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="myantce.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
<?xml version="1.0" encoding="UTF-8"?>
<!--find_content.xsl creates a ANT file get_content-->
<xsl:stylesheet
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: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"/>
<xsl:apply-templates/>
</target>
</project>
</xsl:template>
<xsl:template match="h:rootfiles">
<xsl:apply-templates/>
</xsl:template>
<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"/>
<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"/>
</xsl:template>
</xsl:stylesheet>
<!--find_ressources.xsl creates a ANT file get_ressources-->
<!--the ANT copies all audio files, images and objects used in the content to convert-->
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:html">
<project name="hdoc_to_optim" default="main">
<target name="main">
<xsl:apply-templates select="h:body"/>
</target>
</project>
</xsl:template>
<xsl:template match="h:body">
<xsl:apply-templates select="h:section"/>
</xsl:template>
<xsl:template match="h:section">
<xsl:apply-templates select="h:div"/>
<xsl:apply-templates select="h:section"/>
</xsl:template>
<xsl:template match="h:div">
<xsl:apply-templates select="h:section"/>
<xsl:apply-templates select="h:img"/>
<xsl:apply-templates select="h:object"/>
<xsl:apply-templates select="h:audio"/>
</xsl:template>
<xsl:template match="h:img">
<xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template>
<xsl:template match="h:object">
<xsl:variable name="data" select="@data"/>
<copy file="hdoc/{$data}" tofile="result/{$data}"/>
</xsl:template>
<xsl:template match="h:audio">
<xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:of="scpf.org:office"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:html">
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<of:paper xmlns:of="scpf.org:office" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:apply-templates/>
</of:paper>
</sc:item>
</xsl:template>
<!--Metadata of the head tag-->
<xsl:template match="h:head">
<of:paperM>
<xsl:apply-templates select="h:title"/>
<sp:commonMeta>
<of:commonM>
<!--in optim there is only one tag for author and rights, we must concatenate them-->
<xsl:if test="h:meta[@name='author'] or h:meta[@name='rights']">
<sp:copyright>
<xsl:value-of select="h:meta[@name='author']/@content"/>
<xsl:if test="h:meta[@name='author'] and h:meta[@name='rights']"> - </xsl:if>
<xsl:value-of select="h:meta[@name='rights']/@content"/>
</sp:copyright>
</xsl:if>
<xsl:if test="h:meta[@name='date']">
<sp:version>
<xsl:value-of select="h:meta[@name='date']/@content"/>
</sp:version>
</xsl:if>
</of:commonM>
</sp:commonMeta>
</of:paperM>
<!--in optim there is no tag for description and keywords, they are added in a preliminary part-->
<xsl:if test="h:meta[@name='description'] or h:meta[@name='keywords']">
<sp:pre>
<of:section>
<of:sectionM>
<sp:title>Metadata</sp:title>
</of:sectionM>
<sp:content>
<of:fragment>
<xsl:apply-templates select="h:meta[@name='description']"/>
<xsl:apply-templates select="h:meta[@name='keywords']"/>
</of:fragment>
</sp:content>
</of:section>
</sp:pre>
</xsl:if>
</xsl:template>
<xsl:template match="h:meta[@name='description'] | h:meta[@name='keywords']">
<sp:info>
<of:block>
<of:blockM>
<sp:title>
<xsl:if test="@name='description'">Description</xsl:if>
<xsl:if test="@name='keywords'">Keywords</xsl:if>
</sp:title>
</of:blockM>
<sp:co>
<of:flow>
<sp:txt>
<of:txt>
<sc:para xml:space="preserve">
<xsl:value-of select="@content"/>
</sc:para>
</of:txt>
</sp:txt>
</of:flow>
</sp:co>
</of:block>
</sp:info>
</xsl:template>
<xsl:template match="h:title | h:h1 | h:h6">
<sp:title><xsl:value-of select="."/></sp:title>
</xsl:template>
<xsl:template match="h:body">
<xsl:apply-templates/>
</xsl:template>
<!--hdoc sections can become chapters or sections in Optim, we must differentiate the two-->
<xsl:template match="h:body/h:section">
<sp:chap>
<xsl:call-template name="sec-body"/>
</sp:chap>
</xsl:template>
<xsl:template match="h:section">
<sp:sec>
<xsl:call-template name="sec-body"/>
</sp:sec>
</xsl:template>
<xsl:template name="sec-body">
<of:section>
<xsl:if test="@data-hdoc-type='introduction'">
<xsl:comment>Introduction</xsl:comment>
</xsl:if>
<xsl:if test="@data-hdoc-type='conclusion'">
<xsl:comment>Conclusion</xsl:comment>
</xsl:if>
<xsl:apply-templates select="h:header"/>
<xsl:if test="./h:div">
<sp:content>
<of:fragment>
<xsl:apply-templates select="h:div"/>
</of:fragment>
</sp:content>
</xsl:if>
<xsl:apply-templates select="h:section"/>
</of:section>
<xsl:apply-templates select="h:footer"/>
</xsl:template>
<xsl:template match="h:header">
<of:sectionM>
<xsl:apply-templates/>
</of:sectionM>
</xsl:template>
<xsl:template match="h:footer">
<xsl:apply-templates/>
</xsl:template>
<!--there are no tags for metadata in Optim sections, so we add this information in the comments-->
<xsl:template match="h:div[@data-hdoc-type]">
<xsl:comment>
<xsl:if test="@data-hdoc-type='author'">Author : <xsl:value-of select="."/></xsl:if>
<xsl:if test="@data-hdoc-type='date'">Date : <xsl:value-of select="."/></xsl:if>
<xsl:if test="@data-hdoc-type='rights'">Rights : <xsl:value-of select="."/></xsl:if>
<xsl:if test="@data-hdoc-type='tags'">Tags : <xsl:for-each select="h:span"><xsl:value-of select="."/>, </xsl:for-each></xsl:if>
<xsl:if test="@data-hdoc-type='categories'">Categories : <xsl:for-each select="h:span"><xsl:value-of select="."/>, </xsl:for-each></xsl:if>
</xsl:comment>
</xsl:template>
<xsl:template match="h:div">
<sp:info>
<xsl:call-template name="div-body"/>
</sp:info>
</xsl:template>
<xsl:template match="h:div[@data-hdoc-type='emphasis'] | h:div[@data-hdoc-type='definition'] | h:div[@data-hdoc-type='warning']">
<sp:emphasis>
<xsl:if test="@data-hdoc-type='definition'">
<xsl:comment>Definition</xsl:comment>
</xsl:if>
<xsl:if test="@data-hdoc-type='warning'">
<xsl:comment>Warning</xsl:comment>
</xsl:if>
<xsl:if test="@data-hdoc-type='date'">Date : <xsl:value-of select="."/></xsl:if>
<xsl:call-template name="div-body"/>
</sp:emphasis>
</xsl:template>
<xsl:template match="h:div[@data-hdoc-type='complement'] | h:div[@data-hdoc-type='example'] | h:div[@data-hdoc-type='remark'] | h:div[@data-hdoc-type='advice']">
<sp:extra>
<xsl:if test="@data-hdoc-type='example'">
<xsl:comment>Example</xsl:comment>
</xsl:if>
<xsl:if test="@data-hdoc-type='remark'">
<xsl:comment>Remark</xsl:comment>
</xsl:if>
<xsl:if test="@data-hdoc-type='advice'">
<xsl:comment>Advice</xsl:comment>
</xsl:if>
<xsl:call-template name="div-body"/>
</sp:extra>
</xsl:template>
<xsl:template name="div-body">
<of:block>
<of:blockM>
<xsl:apply-templates select="h:h6"/>
</of:blockM>
<sp:co>
<of:flow>
<sp:txt>
<of:txt>
<xsl:apply-templates select="*[not(self::h:h6)]"/>
</of:txt>
</sp:txt>
</of:flow>
</sp:co>
</of:block>
</xsl:template>
<xsl:template match="h:span">
<xsl:apply-templates/>
</xsl:template>
<!--Text-->
<!--paragraph-->
<xsl:template match="h:p">
<sc:para xml:space="preserve">
<xsl:apply-templates/>
</sc:para>
</xsl:template>
<!--list-->
<xsl:template match="h:ul">
<sc:itemizedList>
<xsl:apply-templates/>
</sc:itemizedList>
</xsl:template>
<xsl:template match="h:ol">
<sc:orderedList>
<xsl:apply-templates/>
</sc:orderedList>
</xsl:template>
<xsl:template match="h:li">
<sc:listItem>
<xsl:apply-templates/>
</sc:listItem>
</xsl:template>
<!--url-->
<xsl:template match="h:a">
<sc:uLink role="url" url="{@href}">
<xsl:apply-templates/>
</sc:uLink>
</xsl:template>
<xsl:template match="h:em">
<sc:inlineStyle role="emphasis">
<xsl:apply-templates/>
</sc:inlineStyle>
</xsl:template>
<xsl:template match="h:i">
<sc:phrase role="special">
<xsl:apply-templates/>
</sc:phrase>
</xsl:template>
<xsl:template match="h:q">
<sc:phrase role="quote">
<xsl:apply-templates/>
</sc:phrase>
</xsl:template>
<!--Table-->
<xsl:template match="h:table">
<sc:table role="">
<xsl:apply-templates select="h:caption"/>
<xsl:for-each select="h:tr[1]/h:td">
<sc:column width="20"/>
</xsl:for-each>
<xsl:apply-templates select="h:tr"/>
</sc:table>
</xsl:template>
<xsl:template match="h:caption">
<sc:caption xml:space="preserve">
<xsl:value-of select="."/>
</sc:caption>
</xsl:template>
<xsl:template match="h:tr">
<sc:row>
<xsl:apply-templates/>
</sc:row>
</xsl:template>
<xsl:template match="h:td">
<sc:cell>
<xsl:apply-templates/>
</sc:cell>
</xsl:template>
<!--Object-->
<xsl:template match="h:object">
<xsl:variable name="data" select="@data"/>
<sc:extBlock role="img" sc:refUri="{$data}"/>
</xsl:template>
<!--Image-->
<xsl:template match="h:img">
<xsl:variable name="src" select="@src"/>
<sc:extBlock role="img" sc:refUri="{$src}"/>
</xsl:template>
<!--Audio-->
<xsl:template match="h:audio">
<xsl:variable name="src" select="@src"/>
<sc:extBlock role="anim" sc:refUri="{$src}"/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<project name="ProjetOpale" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="source.scar" />
<property name="OutputPath" value="result.hdoc" />
<!-- Other properties -->
<property name="UnzipSourcePath" value="UnzipSourcePath" />
<property name="XmlModuleName" value="" />
<property name="TmpPath" value="TmpPath" />
<property name="TmpFile1" value="TmpFile1.xml" />
<property name="RacineFile" value="content.xml" />
<property name="HdocPath" value="hdoc" />
<!-- Others properties (in another file) currently empty -->
<property file="opale_to_hdoc.properties" />
<!-- Beginning -->
<target name="convert">
<antcall target="clean" />
<antcall target="unzip_scar" />
<antcall target="check_source_xml" />
<antcall target="hdoc_structure" />
<antcall target="fusion_xml" />
<antcall target="content_xml" />
<antcall target="zip" />
</target>
<!-- Clean : delete old files -->
<target name="clean">
<!-- create folders (to be sure) -->
<mkdir dir="${UnzipSourcePath}"/>
<mkdir dir="${TmpPath}"/>
<mkdir dir="${HdocPath}"/>
<!-- delete folders -->
<delete dir="${UnzipSourcePath}"/>
<delete dir="${TmpPath}"/>
<delete dir="${HdocPath}"/>
</target>
<!-- Check if only one xml file -->
<target name="check_source_xml">
<!-- count xml files -->
<resourcecount property="xml.count">
<fileset dir="${UnzipSourcePath}" casesensitive="yes">
<include name="*.xml"/>
</fileset>
</resourcecount>
<!-- check if only one xml file -->
<condition property="xml.onlyone">
<equals arg1="${xml.count}" arg2="1"/>
</condition>
<!-- fail if more than one -->
<fail message="Error : too many source file (${xml.count}), source file not found or unreadable." unless="xml.onlyone"/>
</target>
<!-- Unzip scar source file -->
<target name="unzip_scar">
<unzip src="${InputPath}" dest="./${UnzipSourcePath}"/>
</target>
<!-- Create the hdoc structure -->
<target name="hdoc_structure">
<mkdir dir="${HdocPath}"/>
<mkdir dir="${HdocPath}/META-INF" />
<touch file="${HdocPath}/META-INF/container.xml" />
<touch file="${HdocPath}/mimetype" />
<echo message="application/x-hdoc+zip" file="${HdocPath}/mimetype" />
<echoxml file="${HdocPath}/META-INF/container.xml">
<container version="1.0">
<rootfiles>
<rootfile full-path="${HdocPath}/${RacineFile}" media-type="text/xml" />
</rootfiles>
</container>
</echoxml>
</target>
<!-- Make a unique xml source file -->
<target name="fusion_xml">
<!-- get xml source file path -->
<fileset id="fileset_source_xml" dir="${UnzipSourcePath}" casesensitive="yes">
<include name="*.xml"/>
</fileset>
<pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" />
<!-- xsl -->
<xslt style="opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}">
</xslt>
</target>
<!-- Create content.xml -->
<target name="content_xml">
<xslt style="opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" />
</target>
<!-- Zip Hdoc -->
<target name="zip">
<zip destfile="${OutputPath}" basedir="${HdocPath}"/>
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=myantce.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="myantce.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
<?xml version="1.0" encoding="UTF-8"?>