Commit c08edc5b authored by Decorde Jeffrey's avatar Decorde Jeffrey
Browse files

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

parents da86dac8 355e15ff
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<!-- <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef> -->
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
<property name="nameInputsId" refid="inputsId"/>
<echo>Fichier en entree : ${nameInputsId}</echo>
<unzip src="${InputPath}/${nameInputsId}" dest="${srcdir}/${nameInputsId}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<<<<<<< HEAD
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
=======
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<include name="**/*.term"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<!--ajout du mimetype au fichier racine
TODO rajouter le container.xml dans le fichier META-INF et qui pointe sur le fichier transformé : un mkdir avec les inputs à transformer en parametre?-->
<target name="exportOutput" depends="buildOutput">
<copy file="mimetype" tofile="${outdir}/mimetype"></copy>
<<<<<<< HEAD
<copydir src="META-INF" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
=======
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<copydir src="${outdir}/${nameInputsId}" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
<!--<zip basedir="${outdir}" destfile="${OutputPath}/opale-${nameInputsId}" encoding="UTF-8"></zip>-->
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<!-- <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef> -->
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
<property name="nameInputsId" refid="inputsId"/>
<echo>Fichier en entree : ${nameInputsId}</echo>
<unzip src="${InputPath}/${nameInputsId}" dest="${srcdir}/${nameInputsId}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<<<<<<< HEAD
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
=======
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<include name="**/*.term"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<!--ajout du mimetype au fichier racine
TODO rajouter le container.xml dans le fichier META-INF et qui pointe sur le fichier transformé : un mkdir avec les inputs à transformer en parametre?-->
<target name="exportOutput" depends="buildOutput">
<copy file="mimetype" tofile="${outdir}/mimetype"></copy>
<copydir src="${outdir}/${nameInputsId}" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
<!--<zip basedir="${outdir}" destfile="${OutputPath}/opale-${nameInputsId}" encoding="UTF-8"></zip>-->
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
application/x-hdoc+zip
application/x-hdoc+zip
<?xml version="1.0" encoding="UTF-8"?>
<sng:grammar xmlns:sng="http://relaxng.org/ns/structure/1.0"
xmlns:hsoc="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<a:documentation>This schema describes the content file for hdoc format</a:documentation>
<a:documentation>This schema is a restriction of XHTML (it validates XHTML schema, if namespace
is changed to http://www.w3.org/1999/xhtml)</a:documentation>
<a:documentation>Last update : 2014-12-22</a:documentation>
<a:documentation>Changes since last update : Adding biblio management via a href=''
data-hdoc-type='bibtexml' </a:documentation>
<sng:start>
<sng:element name="html" xmlns:hdoc="http://www.utc.fr/ics/hdoc/xhtml">
<ref name="Head"/>
<ref name="Body"/>
</sng:element>
</sng:start>
<sng:define name="Head">
<element name="head">
<!-- mandatory : document title -->
<element name="title">
<text/>
</element>
<!-- mandatory : charset=utf-8 -->
<element name="meta">
<attribute name="charset">
<value>utf-8</value>
</attribute>
</element>
<!-- optional : hdoc source generator -->
<optional>
<element name="meta">
<attribute name="name">
<value>generator</value>
</attribute>
<attribute name="content">
<choice>
<value>SimpleOptim</value>
<value>HdocConverter/SimpleChain</value>
<value>SimpleChain</value>
<value>HdocConverter/Etherpad</value>
<value>HdocConverter/Opale3.4</value>
<value>HdocConverter/Dokiel4.0</value>
<value>HdocConverter/Optim1.2</value>
<value>HdocConverter/Topaze1.3</value>
<value>HdocConverter/wikipedia</value>
<value>HdocConverter/Wordpress</value>
<value>HdocConverter/OpenDocumentText</value>
<value>HdocConverter/LaTeX</value>
<value>HdocConverter/OPML</value>
<value>HdocConverter/DITA</value>
</choice>
</attribute>
</element>
</optional>
<!-- optional : metadata about content ; TODO : date...
-->
<zeroOrMore>
<element name="meta">
<attribute name="name">
<choice>
<value>description</value>
<value>keywords</value>
<value>author</value>
<value>rights</value>
<value>date</value>
</choice>
</attribute>
<attribute name="content">
<text/>
</attribute>
</element>
</zeroOrMore>
</element>
</sng:define>
<define name="Body">
<element name="body">
<ref name="Structure"/>
</element>
</define>
<define name="Structure">
<oneOrMore>
<ref name="Section"/>
</oneOrMore>
</define>
<!-- Recursive and hierachical organization of the document
-->
<define name="Section">
<element name="section">
<!-- optional typing -->
<ref name="SectionType"/>
<!-- mandatory : title (header > h1) -->
<element name="header">
<element name="h1">
<text/>
</element>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>author</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>date</value>
</attribute>
<data type="date"/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>rights</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>introduction</value>
</attribute>
<text/>
</element>
</optional>
</element>
<!-- optional content of the section-->
<optional>
<ref name="Content"/>
</optional>
<!-- optional internal sub-structrure -->
<optional>
<ref name="Structure"/>
</optional>
<!-- optional footer -->
<optional>
<element name="footer">
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>conclusion</value>
</attribute>
<text/>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>tags</value>
</attribute>
<oneOrMore>
<element name="span">
<text/>
</element>
</oneOrMore>
</element>
</optional>
<optional>
<element name="div">
<attribute name="data-hdoc-type">
<value>categories</value>
</attribute>
<oneOrMore>
<element name="span">
<text/>
</element>
</oneOrMore>
</element>
</optional>
</element>
</optional>
</element>
</define>
<!-- A content is a sequence of blocs -->
<define name="Content">
<oneOrMore>
<element name="div">
<!-- optional typing attribute -->
<ref name="DivType"/>
<!-- Optional title of a div -->
<optional>
<element name="h6">
<text/>
</element>
</optional>
<ref name="Flow"/>
</element>
</oneOrMore>
</define>
<!-- A flow is a sequence of media : text, table, image, audio, video, others
-->
<define name="Flow">
<oneOrMore>
<choice>
<ref name="Text"/>
<ref name="Table"/>
<ref name="Image"/>
<ref name="Audio"/>
<ref name="Video"/>
<ref name="Object"/>
</choice>
</oneOrMore>
</define>
<!-- Text -->
<define name="Text">
<oneOrMore>
<choice>
<ref name="P"/>
<ref name="L"/>
</choice>
</oneOrMore>
</define>
<!-- Paragraphe -->
<define name="P">
<element name="p">
<ref name="Inline"/>
</element>
</define>
<!-- Inline elements -->
<define name="Inline">
<!-- TODO : cite, code, sub, sup... -->
<zeroOrMore>
<choice>
<text/>
<element name="em">
<ref name="Inline"/>
</element>
<element name="i">
<ref name="Inline"/>
</element>
<element name="q">
<ref name="Inline"/>
</element>
<element name="sub">
<ref name="Inline"/>
</element>
<element name="sup">
<ref name="Inline"/>
</element>
<element name="a">
<attribute name="href">
<data type="anyURI"/>
</attribute>
<optional>
<!-- Biblio reference management -->
<attribute name="data-hdoc-type">
<value>bibtexml</value>
</attribute>
</optional>
<ref name="Inline"/>
</element>
<element name="span">
<ref name="SpanType"/>
<ref name="Inline"/>
</element>
</choice>
</zeroOrMore>
</define>
<!-- List -->
<define name="L">
<choice>
<element name="ul">
<ref name="I"/>
</element>
<element name="ol">
<ref name="I"/>
</element>
</choice>
</define>
<!-- List item -->
<define name="I">
<oneOrMore>
<element name="li">
<ref name="Text"/>
</element>
</oneOrMore>
</define>
<!-- Table -->
<define name="Table">
<element name="table">
<optional>
<element name="caption">
<text/>
</element>
</optional>
<oneOrMore>
<element name="tr">
<oneOrMore>
<element name="td">
<ref name="Text"/>
</element>
</oneOrMore>
</element>
</oneOrMore>
</element>
</define>
<!-- Image -->
<define name="Image">
<element name="img">
<attribute name="src">
<data type="anyURI"/>
</attribute>
<attribute name="alt">
<text/>
</attribute>
</element>
</define>
<!-- Audio -->
<define name="Audio">
<element name="audio">
<attribute name="src">
<data type="anyURI"/>
</attribute>
</element>
</define>
<!-- Vidéo -->
<define name="Video">
<element name="video">
<attribute name="src">
<data type="anyURI"/>
</attribute>
<ref name="VideoType"/>
</element>
</define>
<!-- Other external resources -->
<define name="Object">
<element name="object">
<ref name="ObjectType"/>
<attribute name="data">
<data type="anyURI"/>
</attribute>
<empty/>
</element>
</define>
<!-- Microdata and other Types -->
<include href="type.rng"/>
</grammar>
@echo off
set lib=lib
<<<<<<< HEAD
set ant=lexique_to_hdoc.ant
=======
set ant=lexique_to_opale.ant
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
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="lexique_to_hdoc.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"?>
<?oxygen RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml" ?>
<html xmlns="http://www.utc.fr/ics/hdoc/xhtml">
<head>
<title>Hello world</title>
<meta charset="utf-8"/>
<meta name="author" content="Stéphane Crozat"/>
</head>
<body>
<section>
<header>
<h1>First section</h1>
</header>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</section>
<section>
<header>
<h1>Second section</h1>
</header>
<div>
<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</section>
</body>
</html>
\ No newline at end of file
<?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"
<<<<<<< HEAD
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:lx="scpf.org:lexicon"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:op="utc.fr:ics/opale3"
exclude-result-prefixes="xs"
version="2.0">
=======
xmlns:hodoc="http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes="xs"
version="1.0">
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<!-- <sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<op:glos xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:op="utc.fr:ics/opale3"> -->
<html xmlns:hodoc="http://www.utc.fr/ics/hdoc/xhtml">
<head>
<!--
GESTION DES TAGS: classe contenant la définition
-->
<xsl:variable name="tag"> <xsl:value-of select="document(@sc:refUri)/sc:item/lx:tag/lx:tagM/sp:title"/></xsl:variable>
<title class="$tag">
<xsl:value-of select="sc:item/lx:term/lx:termM/sp:name"></xsl:value-of>
</title>
<meta charset="utf-8"/>
</head>
<body>
<h2 span="titre_def">
<xsl:value-of select="sc:item/lx:term/lx:termM/sp:name"></xsl:value-of>
</h2>
<!--grammaire et type du mot en italique entre crochets -->
<<<<<<< HEAD
<xsl:if test="sc:item/lx:term/lx:termM/sp:grammar">
<i>
[<xsl:apply-templates select="sc:item/lx:term/lx:termM/sp:grammar"></xsl:apply-templates>]
</i>
</xsl:if>
<xsl:if test="sc:item/lx:term/lx:termM/sp:type">
<i>
[<xsl:apply-templates select="sc:item/lx:term/lx:termM/sp:type"></xsl:apply-templates>]