Commit d1e5f521 authored by aperdria's avatar aperdria
Browse files

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

parents 6bb65133 16be50dc
...@@ -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>
......
...@@ -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>
......
...@@ -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>
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<!-- Clean : delete old files --> <!-- Clean : delete old files -->
<target name="clean"> <target name="clean">
<!-- delete folders --> <!-- delete folders -->
<!--delete dir="${UnzipSourcePath}"/--> <delete dir="${UnzipSourcePath}"/>
<!--delete dir="${TmpPath}"/--> <delete dir="${TmpPath}"/>
<!--delete dir="${HdocPath}"/--> <delete dir="${HdocPath}"/>
</target> </target>
<!-- Check if only one xml file --> <!-- Check if only one xml file -->
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:op="utc.fr:ics/opale3"> xmlns:op="utc.fr:ics/opale3">
<xsl:template match="sc:item">
<xsl:apply-templates/>
</xsl:template>
<!-- MODULE --> <!-- MODULE -->
<xsl:template match="op:ue"> <xsl:template match="op:ue">
...@@ -109,7 +113,11 @@ ...@@ -109,7 +113,11 @@
</header> </header>
<!-- currently : grain & introduction & conclusion --> <!-- currently : grain & introduction & conclusion -->
<xsl:apply-templates select="./op:courseUa/child::*[name() != 'op:uM'][name() != 'sp:quest']"/> <!-- <xsl:apply-templates select="./op:courseUa/child::*[name() != 'op:uM'][name() != 'sp:quest']"/>-->
<xsl:apply-templates select="./op:courseUa/sp:courseUc"/>
<xsl:apply-templates select="./op:courseUa/sp:intro"/>
<xsl:apply-templates select="./op:courseUa/sp:conclu"/>
<xsl:apply-templates select="./op:courseUa/sp:obj"/>
<!-- overview questions : regroup questions into a section--> <!-- overview questions : regroup questions into a section-->
<xsl:if test="./op:courseUa/sp:quest"> <xsl:if test="./op:courseUa/sp:quest">
...@@ -140,7 +148,8 @@ ...@@ -140,7 +148,8 @@
</header> </header>
<!-- call for blocs and parts --> <!-- call for blocs and parts -->
<xsl:apply-templates select="./op:expUc/child::*[name() != 'op:uM']"/> <!-- <xsl:apply-templates select="./op:expUc/child::*[name() != 'op:uM']"/>-->
<xsl:apply-templates select="./op:expUc/sp:pb/op:pb/*"/>
<footer> <footer>
<xsl:apply-templates select="./op:expUc/op:uM/sp:info/op:info/sp:keywds"/> <xsl:apply-templates select="./op:expUc/op:uM/sp:info/op:info/sp:keywds"/>
...@@ -186,6 +195,12 @@ ...@@ -186,6 +195,12 @@
</section> </section>
</xsl:template> </xsl:template>
<xsl:template match="sp:filtered">
<xsl:if test="op:filter/sp:exclude/text() = 'short'">
<xsl:apply-templates select="./op:res/*"/>
</xsl:if>
</xsl:template>
<!-- Overview questions (fr : question de synthèse) --> <!-- Overview questions (fr : question de synthèse) -->
<xsl:template match="sp:quest"> <xsl:template match="sp:quest">
<xsl:apply-templates select="./op:txt/*"/> <xsl:apply-templates select="./op:txt/*"/>
...@@ -437,4 +452,6 @@ ...@@ -437,4 +452,6 @@
</p> </p>
</xsl:template> </xsl:template>
<xsl:template match="*"></xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -7,8 +7,7 @@ Put `.scar` files in the input folder, run `run.bat` or `run.sh` and get results ...@@ -7,8 +7,7 @@ Put `.scar` files in the input folder, run `run.bat` or `run.sh` and get results
Todo list Todo list
--------- ---------
- tests more files (with As We May) - tests more files
- add schema validation
- clean output of optim source files - clean output of optim source files
- resolve bugs - resolve bugs
- test the entier process from optim to opale - test the entier process from optim to opale
...@@ -17,7 +16,8 @@ Todo list ...@@ -17,7 +16,8 @@ Todo list
Bugs Bugs
---- ----
- references of sections or fragments inside a paragraphe ; - references of sections or fragments inside a paragraphe
- can create divs with only h6
Transformation Transformation
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
<project basedir="." name="optim_to_hdoc"> <project basedir="." name="optim_to_hdoc">
<taskdef resource="net/sf/antcontrib/antlib.xml"/> <taskdef resource="net/sf/antcontrib/antlib.xml"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="lib/jing.jar"/>
</classpath>
</taskdef>
<property name="in" location="${basedir}/input"/> <property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/> <property name="out" location="${basedir}/output"/>
...@@ -27,7 +32,7 @@ ...@@ -27,7 +32,7 @@
</path> </path>
<sequential> <sequential>
<local name="archive_name"/> <local name="archive_name"/>
<basename property="archive_name" file="@{archive}"/> <basename property="archive_name" file="@{archive}" suffix=".scar"/>
<unzip src="@{archive}" dest="${tmp}/extract/${archive_name}"></unzip> <unzip src="@{archive}" dest="${tmp}/extract/${archive_name}"></unzip>
</sequential> </sequential>
</for> </for>
...@@ -49,7 +54,6 @@ ...@@ -49,7 +54,6 @@
<echo message="Convert to hdoc..."/> <echo message="Convert to hdoc..."/>
<xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/> <xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/>
<echo message="Copy ressources files..."/> <echo message="Copy ressources files..."/>
...@@ -78,6 +82,16 @@ ...@@ -78,6 +82,16 @@
<fileset dir="@{folder}" includes="*.html" /> <fileset dir="@{folder}" includes="*.html" />
</first> </first>
<move file="${toString:first}" tofile="@{folder}/content.xml"/> <move file="${toString:first}" tofile="@{folder}/content.xml"/>
<trycatch property="foo" reference="bar">
<try>
<jing file="@{folder}/META-INF/container.xml" rngfile="../schemas/container/hdoc1-container.rng"></jing>
<jing file="@{folder}/content.xml" rngfile="../schemas/xhtml/hdoc1-xhtml.rng"></jing>
</try>
<catch>
<echo>Validation error of hdoc output</echo>
</catch>
</trycatch>
</sequential> </sequential>
</for> </for>
......
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