Commit 9c772450 authored by Ivan D'halluin's avatar Ivan D'halluin
Browse files

add validation with try catch

parent 5d3a6774
...@@ -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