Commit 8da14483 authored by harriga_merouane@hotmail.fr's avatar harriga_merouane@hotmail.fr

Merge

parents ac694476 179e986a
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<project basedir=".." name="main" default="convert"> <project basedir=".." name="main" default="convert">
<property name="InputPath" value="bib2.bib"></property> <property name="InputPath" value="bib2.bib"></property>
<property name="OutputPath" value="${basedir}\result\ref.scar"></property> <property name="OutputPath" value="${basedir}\result\ref.scar"></property>
<property name="lib" value="${basedir}/lib"/>
<target name="convert"> <target name="convert">
<antcall target="preparation"/> <antcall target="preparation"/>
<antcall target="BibtexToBibXml"/> <antcall target="BibtexToBibXml"/>
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
<antcall target="zip"/> <antcall target="zip"/>
<antcall target="CleanDirectory"/> <antcall target="CleanDirectory"/>
</target> </target>
<target name="preparation"> <target name="preparation">
<delete dir="${basedir}/result"></delete> <delete dir="${basedir}/result"></delete>
<mkdir dir="${basedir}/result"></mkdir> <mkdir dir="${basedir}/result"></mkdir>
...@@ -26,52 +27,52 @@ ...@@ -26,52 +27,52 @@
<mkdir dir="${basedir}/decompressedOpale/ref"></mkdir> <mkdir dir="${basedir}/decompressedOpale/ref"></mkdir>
<mkdir dir="${basedir}/tmp"></mkdir> <mkdir dir="${basedir}/tmp"></mkdir>
</target> </target>
<target name="CleanDirectory"> <target name="CleanDirectory">
<delete dir="${basedir}/tmp"></delete> <delete dir="${basedir}/tmp"></delete>
<delete dir="${basedir}/java"></delete> <delete dir="${basedir}/java"></delete>
<delete dir="${basedir}/decompressedOpale"></delete> <delete dir="${basedir}/decompressedOpale"></delete>
</target> </target>
<target name="BibtexToBibXml"> <target name="BibtexToBibXml">
<!-- Convert Bibtex into BibtexXml --> <!-- Convert Bibtex into BibtexXml -->
<java <java
fork="true" fork="true"
failonerror="true" failonerror="true"
jar="lib/bibtex.jar" jar="${lib}/bibtex.jar"
> >
<arg value="${InputPath}"/> <arg value="${InputPath}"/>
<arg value="${basedir}/tmp"/> <arg value="${basedir}/tmp"/>
<arg value="/tmpBibXml.xml"/> <arg value="/tmpBibXml.xml"/>
</java> </java>
</target> </target>
<target name="BibXmlToHdocBib"> <target name="BibXmlToHdocBib">
<!-- Convert from BibXlm to HdocBib --> <!-- Convert from BibXlm to HdocBib -->
<xslt classpath="${basedir}/lib/saxon9he.jar" <xslt classpath="${basedir}/${lib}/saxon9he.jar"
in="${basedir}\tmp\tmpBibXml.xml" out="${basedir}\tmp\tmpHdocBib.xml" in="${basedir}\tmp\tmpBibXml.xml" out="${basedir}\tmp\tmpHdocBib.xml"
xslresource="${basedir}/XSL/BibToHdoc.xsl"></xslt> xslresource="${basedir}/XSL/BibToHdoc.xsl"></xslt>
</target> </target>
<target name="HdocToOpale"> <target name="HdocToOpale">
<!-- Convert from HdocBib to Opale --> <!-- Convert from HdocBib to Opale -->
<xslt in="${basedir}\tmp\tmpHdocBib.xml" <xslt in="${basedir}\tmp\tmpHdocBib.xml"
out="${basedir}/tmp/tempHdoc.xml" out="${basedir}/tmp/tempHdoc.xml"
xslresource="${basedir}/XSL/SeparateXmlt.xsl"> xslresource="${basedir}/XSL/SeparateXmlt.xsl">
<param name="in" expression="${basedir}\tmp\tmpHdocBib.xml"></param> <param name="in" expression="${basedir}\tmp\tmpHdocBib.xml"></param>
<param name="out" expression="${basedir}\decompressedOpale\ref"></param> <param name="out" expression="${basedir}\decompressedOpale\ref"></param>
</xslt> </xslt>
<ant antfile="${basedir}/tmp/tempHdoc.xml"/> <ant antfile="${basedir}/tmp/tempHdoc.xml"/>
</target> </target>
<target name="zip"> <target name="zip">
<chmod dir="${basedir}/decompressedOpale" perm="777"></chmod> <chmod dir="${basedir}/decompressedOpale" perm="777"></chmod>
<copy file=".wspmeta" todir="${basedir}/decompressedOpale"/> <copy file=".wspmeta" todir="${basedir}/decompressedOpale"/>
<zip basedir="decompressedOpale" destfile="${OutputPath}" encoding="UTF-8"/> <zip basedir="decompressedOpale" destfile="${OutputPath}" encoding="UTF-8"/>
<chmod dir="${OutputPath}" perm="777"/> <chmod dir="${OutputPath}" perm="777"/>
</target> </target>
</project> </project>
\ No newline at end of file
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<property name="log" location="${basedir}/log"/> <property name="log" location="${basedir}/log"/>
<property name="schema" location="${basedir}/schema"/> <property name="schema" location="${basedir}/schema"/>
<property name="bibtex" location="${basedir}/bibtex_to_opale"/> <property name="bibtex" location="${basedir}/bibtex_to_opale"/>
<property file="global.properties"/> <property file="global.properties"/>
<target name="convert"> <target name="convert">
...@@ -91,6 +90,7 @@ ...@@ -91,6 +90,7 @@
</first> </first>
<xslt in="${toString:first}" out="${tmp}/${filename}/generateContentPath.xml" style="${xsl}/transformation0.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> <xslt in="${toString:first}" out="${tmp}/${filename}/generateContentPath.xml" style="${xsl}/transformation0.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
<param name="filename" expression="${filename}"/> <param name="filename" expression="${filename}"/>
<param name="lib" expression="${lib}"/>
</xslt> </xslt>
<chmod file="${tmp}/${filename}/generateContentPath.xml" perm="777"/> <chmod file="${tmp}/${filename}/generateContentPath.xml" perm="777"/>
</sequential> </sequential>
...@@ -146,7 +146,14 @@ ...@@ -146,7 +146,14 @@
<sequential> <sequential>
<local name="filename"/> <local name="filename"/>
<basename property="filename" file="@{inputFile}"/> <basename property="filename" file="@{inputFile}"/>
<jing file="${tmp}/${filename}/decompressedHdoc/META-INF/container.xml" rngfile="${schema}/hdoc1-container.rng"></jing> <trycatch property="foo" reference="bar">
<try>
<jing file="${tmp}/${filename}/decompressedHdoc/META-INF/container.xml" rngfile="${schema}/hdoc1-container.rng"></jing>
</try>
<catch>
<echo>Validation failed</echo>
</catch>
</trycatch>
</sequential> </sequential>
</for> </for>
</target> </target>
...@@ -160,7 +167,14 @@ ...@@ -160,7 +167,14 @@
<sequential> <sequential>
<local name="filename"/> <local name="filename"/>
<basename property="filename" file="@{inputFile}"/> <basename property="filename" file="@{inputFile}"/>
<jing file="${tmp}/${filename}/decompressedOpale/main.xml" rngfile="${schema}/op_ue.rng"></jing> <trycatch property="foo" reference="bar">
<try>
<jing file="${tmp}/${filename}/decompressedOpale/main.xml" rngfile="${schema}/op_ue.rng"></jing>
</try>
<catch>
<echo>Validation failed</echo>
</catch>
</trycatch>
</sequential> </sequential>
</for> </for>
</target> </target>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<property name="filename" location="${{tmp}}/{$filename}"/> <property name="filename" location="${{tmp}}/{$filename}"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"> <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath> <classpath>
<pathelement location="../lib/jing.jar"/> <pathelement location="../${lib}/jing.jar"/>
</classpath> </classpath>
</taskdef> </taskdef>
...@@ -43,7 +43,14 @@ ...@@ -43,7 +43,14 @@
<param name="elementid" expression="{@data-export-id}"/> <param name="elementid" expression="{@data-export-id}"/>
</xslt> </xslt>
<jing file="${{filename}}/decompressedOpaleDivided/{@data-export-file}" rngfile="${{schema}}/op_expUc.rng"></jing> <trycatch property="foo" reference="bar">
<try>
<jing file="${{filename}}/decompressedOpaleDivided/{@data-export-file}" rngfile="${{schema}}/op_expUc.rng"></jing>
</try>
<catch>
<echo>Validation failed</echo>
</catch>
</trycatch>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
<project name="getContentFileAndTransformIt" basedir="." default="start"> <project name="getContentFileAndTransformIt" basedir="." default="start">
<property file="global.properties"/> <property file="global.properties"/>
<property name="filename" location="${filename}"/> <property name="filename" location="${filename}"/>
<property name="lib" location="${lib}"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"> <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath> <classpath>
<pathelement location="../lib/jing.jar"/> <pathelement location="../${lib}/jing.jar"/>
</classpath> </classpath>
</taskdef> </taskdef>
...@@ -21,8 +22,14 @@ ...@@ -21,8 +22,14 @@
<xsl:template match="c:rootfiles"> <xsl:template match="c:rootfiles">
<target name="start"> <target name="start">
<jing file="${{tmp}}/${{filename}}/decompressedHdoc/{c:rootfile/@full-path}" rngfile="${{schema}}/hdoc1-xhtml.rng"></jing> <trycatch property="foo" reference="bar">
<try>
<jing file="${{tmp}}/${{filename}}/decompressedHdoc/{c:rootfile/@full-path}" rngfile="${{schema}}/hdoc1-xhtml.rng"></jing>
</try>
<catch>
<echo>Validation failed</echo>
</catch>
</trycatch>
<xslt <xslt
in="${{tmp}}/${{filename}}/decompressedHdoc/{c:rootfile/@full-path}" in="${{tmp}}/${{filename}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmp}}/${{filename}}/moveRessourceFiles.xml" out="${{tmp}}/${{filename}}/moveRessourceFiles.xml"
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<xsl:apply-templates select="h:img"/> <xsl:apply-templates select="h:img"/>
<xsl:apply-templates select="h:object"/> <xsl:apply-templates select="h:object"/>
<xsl:apply-templates select="h:audio"/> <xsl:apply-templates select="h:audio"/>
<xsl:apply-templates select="h:video"/>
</xsl:template> </xsl:template>
<xsl:template match="h:img"> <xsl:template match="h:img">
...@@ -45,6 +46,11 @@ ...@@ -45,6 +46,11 @@
<xsl:variable name="src" select="@src"/> <xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/> <copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template> </xsl:template>
<xsl:template match="h:video">
<xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
......
...@@ -294,5 +294,11 @@ ...@@ -294,5 +294,11 @@
<xsl:variable name="src" select="@src"/> <xsl:variable name="src" select="@src"/>
<sc:extBlock role="anim" sc:refUri="{$src}"/> <sc:extBlock role="anim" sc:refUri="{$src}"/>
</xsl:template> </xsl:template>
<!--Video-->
<xsl:template match="h:video">
<xsl:variable name="src" select="@src"/>
<sc:extBlock role="anim" sc:refUri="{$src}"/>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
\ No newline at end of file
# Converter lexique_to_opale # Converter lexique_to_opale
In order to use this converter, follow those steps : In order to use this converter, follow those steps :
0. Create an input and an output directory
1. Copy your Lexique file(s) (.scar or .zip) into the input directory. 1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS. 2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The names of the output are linked to the hour it was processed. 3. You will find the result into the output directory. The names of the output are linked to the hour it was processed.
...@@ -15,13 +15,22 @@ ...@@ -15,13 +15,22 @@
</classpath> </classpath>
</taskdef> </taskdef>
<target name="rmOutputDir">
<if>
<available file="${OutputPath}" type="dir"/>
<then>
<delete dir="${OutputPath}"/>
</then>
</if>
</target>
<target name="init"> <target name="init" depends="rmOutputDir">
<mkdir dir="${outdir}"/> <mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod> <chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/> <mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod> <chmod perm="777" dir="${srcdir}"></chmod>
<mkdir dir="${OutputPath}"/>
<chmod perm="777" dir="${OutputPath}"></chmod>
</target> </target>
<target name="unzipSource" depends="init"> <target name="unzipSource" depends="init">
......
# Converter lexique_to_optim # Converter lexique_to_optim
In order to use this converter, follow those steps : In order to use this converter, follow those steps :
0. Create an input and an output dir
1. Copy your Lexique file(s) (.scar or .zip) into the input directory. 1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS. 2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The name of the output files depends of the hour it was processed. 3. You will find the result into the output directory. The name of the output files depends of the hour it was processed.
...@@ -16,7 +16,16 @@ ...@@ -16,7 +16,16 @@
</classpath> </classpath>
</taskdef> </taskdef>
<target name="init"> <target name="rmOutputDir">
<if>
<available file="${OutputPath}" type="dir"/>
<then>
<delete dir="${OutputPath}"/>
</then>
</if>
</target>
<target name="init" depends="rmOutputDir">
<mkdir dir="${outdir}"/> <mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod> <chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/> <mkdir dir="${srcdir}"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?><map version="0.8.1"><node CREATED="1450641851216" ID="2nngtspni6hi1484pfec44c8lk" MODIFIED="1450641851216" TEXT="MindMapping"><node CREATED="1450641851217" ID="00lp6bpfm6jibhcjrpdonrhoqb" MODIFIED="1450641851217" POSITION="right" TEXT="#1 MindMapping to Hdoc"><node CREATED="1450641851217" ID="3qm1jgu7dfgs328jthlek5fd4e" MODIFIED="1450641851217" TEXT="Prendre en main le projet existant"/><node CREATED="1450641851217" ID="0u38ectmhqqp4p08p5guvgij71" MODIFIED="1450641851217" TEXT="Corriger les bugs existants"/><node CREATED="1450641851217" ID="3b1t9o2te6enh59j4iv48f4mdi" MODIFIED="1450641851217" TEXT="Restructurer le ant"/></node><node CREATED="1450641851217" ID="6lohsep5crh5g3ngj8ld8loei6" MODIFIED="1450641851217" POSITION="right" TEXT="#2 MindMapping to Opale"><node CREATED="1450641851217" ID="5pl3210hq6if3nv7r2chtjstmo" MODIFIED="1450641851217" TEXT="Faire la connexion avec le transformateur Hdoc to Opale"/><node CREATED="1450641851217" ID="3haa2fgohe9j4n04ilddco84uh" MODIFIED="1450641851217" TEXT="Permettre la personnalisation de l'organisation du module"><node CREATED="1450641851217" ID="4ie264076qt3tnlu0pqpp1dh1p" MODIFIED="1450641851217" TEXT="A l'aide de hashtag"/><node CREATED="1450641851217" ID="23mafrh60fmdmkjsp1jdg6c58g" MODIFIED="1450641851217" TEXT="A l'aide d'attributs"/></node><node CREATED="1450641851217" ID="11k2hbkcu415e1mgk5c5ucr48k" MODIFIED="1450641851217" TEXT="Permettre la personnalisation dy type de noeud (Intro, conclusion etc.)"><node CREATED="1450641851217" ID="5pf0idbv9nln725d14rs1c1p0a" MODIFIED="1450641851217" TEXT="A l'aide d'attributs"/><node CREATED="1450641851217" ID="48799q1i5c6rns3smpa8vnekfb" MODIFIED="1450641851217" TEXT="A l'aide de hashtag"/></node><node CREATED="1450641851217" ID="4npf8jpvak3lffn9c1rsogi0sq" MODIFIED="1450641851217" TEXT="Permettre la personnalisation grâce aux couleurs/icônes"/></node><node CREATED="1450641851217" ID="3n8v43p8qb005puq3qiv7aiubc" MODIFIED="1450641851217" POSITION="right" TEXT="#3 MindMapping to Optim"><node CREATED="1450641851217" ID="2bn1la3apnjf1fi8qqfqde226t" MODIFIED="1450641851217" TEXT="Faire la connexion avec le transformateur Hdoc to Optim"/></node><node CREATED="1450641851217" ID="3s00si3hquol4pldg7lo9opjd6" MODIFIED="1450641851217" POSITION="right" TEXT="#4 MindMapping to Lexique"><node CREATED="1450641851217" ID="37jlfl25iuaoe6f2cpiv30qksd" MODIFIED="1450641851217" TEXT="Faire la connexion avec le transformateur Hdoc to Lexique"/></node><node CREATED="1450641851217" ID="27gnl6pgottjfiukpa3ulfdjrj" MODIFIED="1450641851217" POSITION="left" TEXT="#5 Prendre d'autres outils de carte mentales en entrée"/><node CREATED="1450641851217" ID="24d41nnnnvvu7fv5m8m4vegu0g" MODIFIED="1450641851217" POSITION="left" TEXT="#intro This converter aims at convert a given MindMapping file into a Hdoc file which then will be imported in Opale (advanced only)."/><node CREATED="1450641851217" ID="6a7pr2b5vvmq6na5964dhf9e13" MODIFIED="1450641851217" POSITION="left" TEXT="#conclu DONE : MindMapping to Hdoc, MindMapping to Opale TODO : MindMapping to Optim, MindMapping to Lexique"/></node></map>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="default"> <project basedir="." default="default">
<property name="in" location="${basedir}/input"/> <property name="in" location="${basedir}/input"/>
<property name="out" value="${basedir}/result"/> <property name="out" value="${basedir}/output"/>
<property name="module" value="default"/> <property name="module" value="default"/>
<property name="resultFile" value="${basedir}/result"/> <property name="resultFile" value="${basedir}/output"/>
<taskdef resource="net/sf/antcontrib/antlib.xml"> <taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath> <classpath>
<pathelement location="${basedir}/lib/ant-contrib.jar"/> <pathelement location="${basedir}/lib/ant-contrib.jar"/>
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<echo>Setting up the conversion</echo> <echo>Setting up the conversion</echo>
<delete dir="${basedir}/temp"/> <delete dir="${basedir}/temp"/>
<mkdir dir="${basedir}/temp"/> <mkdir dir="${basedir}/temp"/>
<delete dir="${basedir}/result"/> <delete dir="${basedir}/output"/>
<mkdir dir="${basedir}/result"/> <mkdir dir="${basedir}/output"/>
<echo>--- End ----</echo> <echo>--- End ----</echo>
</target> </target>
......
<map version="0.9.0">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1418378469636" ID="ID_1761352614" MODIFIED="1418378846033" TEXT="Compte rendu reunion">
<node CREATED="1418378601388" ID="ID_316552916" MODIFIED="1418378852113" POSITION="left" TEXT="Avanc&#xe9; du travail">
<node CREATED="1418378754221" ID="ID_378495707" MODIFIED="1418378796204" TEXT="Am&#xe9;lioration du rendement"/>
<node CREATED="1418378777668" ID="ID_1029064924" MODIFIED="1418378790435" TEXT="Cr&#xe9;ation d&apos;un nouveau systeme de paiement"/>
</node>
<node CREATED="1418378647414" ID="ID_58016685" MODIFIED="1418378674936" POSITION="left" TEXT="R&#xe9;sultat courrant">
<node CREATED="1418378826291" ID="ID_1497466150" MODIFIED="1418378837905" TEXT="70% du travail fait"/>
</node>
<node CREATED="1418378677920" ID="ID_92198961" MODIFIED="1418378859207" POSITION="left" TEXT="Rappel du travail &#xe0; realiser">
<node CREATED="1418378863191" ID="ID_1997168106" MODIFIED="1418378890823" TEXT="Changement du process de relation client">
<node CREATED="1418378925585" ID="ID_1529753947" MODIFIED="1418378933336" TEXT="Formation"/>
<node CREATED="1418378953204" ID="ID_1194109046" MODIFIED="1418378981259" TEXT="Sondage client&#xe8;le"/>
</node>
<node CREATED="1418378895031" ID="ID_412980386" MODIFIED="1418378920965" TEXT="Trouver de nouveaux client d&apos;ici la fin de l&apos;ann&#xe9;e"/>
</node>
</node>
</map>
...@@ -19,7 +19,7 @@ Use a terminal and go to the root of the folder (mindmapping_to_opale). ...@@ -19,7 +19,7 @@ Use a terminal and go to the root of the folder (mindmapping_to_opale).
- On Linux : sh run.sh -DinputPath input/<yourFilename> - On Linux : sh run.sh -DinputPath input/<yourFilename>
- On Windows : run.bat -DinputPath input/<yourFilename> - On Windows : run.bat -DinputPath input/<yourFilename>
You will find the result in the folder mindmapping_to_opale/result You will find the result in the folder mindmapping_to_opale/output
IMPORTANT IMPORTANT
......
decompressedHdoc
decompressedOpale
*.scar
*.zip
Bachimont
generateContentPath.xml
moveRessourceFiles.xml
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:op="utc.fr:ics/opale3"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template name="string-to-lowercase">
<xsl:param name="lcletters">abcdefghijklmnopqrstuvwxyzeeeeaaaa</xsl:param>
<xsl:param name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZéèêëàâàá</xsl:param>
<xsl:param name="text"/>
<xsl:value-of select="translate($text,$ucletters,$lcletters)"/>
</xsl:template>
<xsl:template name="string-to-slug">
<xsl:param name="text" select="''" />
<xsl:variable name="dodgyChars" select="' ,.#_-!?*:;=+&#10;/(){}'" />
<xsl:variable name="replacementChar" select="'------------------'" />
<xsl:variable name="oneline">
<xsl:value-of select="normalize-space(translate($text,'&#10;',''))"/>
</xsl:variable>
<xsl:variable name="lowercased"><xsl:call-template name="string-to-lowercase"><xsl:with-param name="text" select="$oneline" /></xsl:call-template></xsl:variable>
<xsl:variable name="escaped"><xsl:value-of select="translate( $lowercased, $dodgyChars, $replacementChar )" /></xsl:variable>
<xsl:variable name="cleaned">
<xsl:call-template name="string-replace-caller">
<xsl:with-param name="text" select="$escaped" />
<xsl:with-param name="replace" select="'---'" />
<xsl:with-param name="by" select="'-'" />
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$cleaned" />
</xsl:template>
<xsl:template name="string-replace-all">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$by"/>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="string-replace-caller">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:variable name="changed">
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($changed,$replace)">
<xsl:call-template name="string-replace-caller">
<xsl:with-param name="text" select="$changed"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$changed"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="sp:courseUc">
<sp:courseUc>
<xsl:variable name="slug">
<xsl:call-template name="string-to-slug">
<xsl:with-param name="text" select="op:expUc/op:uM/sp:title"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="id">
<xsl:value-of select="count(preceding::sp:courseUc)+1"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$slug"/>
</xsl:variable>
<xsl:attribute name="data-export-id">
<xsl:text>uoc-</xsl:text>
<xsl:value-of select="$id" />
</xsl:attribute>
<xsl:attribute name="data-export-file">unit-<xsl:value-of select="$id"/>.xml</xsl:attribute>
<xsl:apply-templates select="@*|node()" />
</sp:courseUc>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:op="utc.fr:ics/opale3"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="sp:courseUc">
<sp:courseUc>
<xsl:attribute name="sc:refUri">
<xsl:value-of select="@data-export-file" />
</xsl:attribute>
</sp:courseUc>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:op="utc.fr:ics/opale3"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- The ID of the courseUc element that needs to be copied has to be passed here -->
<xsl:param name="elementid" xsl:required="yes" xsl:as="xsl:string"/>
<xsl:template match="sc:item">
<xsl:apply-templates select=".//sp:courseUc"/>
</xsl:template>
<xsl:template match="sp:courseUc[@data-export-id = $elementid]">
<sc:item>
<!-- Once we are in the right courseUc, we can just copy everything -->
<xsl:copy-of select="./*"/>
</sc:item>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>
\ No newline at end of file
tmpdir=tmp
OutputPathDivided=divided.scar
OutputPath=out.scar
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="hdoc_to_opale" basedir="." default="convert">
<property file="global.properties"/>