Commit 94153045 authored by Stephane Crozat's avatar Stephane Crozat

init

parents
output
tmp
log
This diff is collapsed.
z2s
version 0.6.20170228.1
AUTHOR
Stéphane Crozat
http://stph.crzt.fr
LICENCE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-> Doc utilisateur dans le README
-> Paramétrage : fichier de properties, dossier de sortie...
-> liste de ref biblio en section Optim (paramétrable) (en cours)
-> gestion de type (section Optim) + webo/biblio Opale (paramétrable)
-> gérer double edition (YYYY/YYYY) ou autre format (paramètre édition par exemple)
-> gérer "Translated by"
-> trouver un moyen de mutualiser "edition | publisher | pubPlace | note[@type='thesisType']"
-> ajouter autres contributors (editeurs par exemple)
This diff is collapsed.
File added
@echo off
set lib=lib
set ant=zoterotei2scenari.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="zoterotei2scenari.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
This diff is collapsed.
<?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"
exclude-result-prefixes="xs"
version="2.0">
<!--****************************************************************
Last update : 2015/05/13
Add translate / to -
Add translate – to -
*****************************************************************-->
<xsl:template name="ValueOfAsURI">
<xsl:param name="pInput"></xsl:param>
<xsl:value-of select="
translate(
normalize-space($pInput),
' AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖöØøÙùÚúÛûÜüÝýÞþ–/',
'_aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaaaaaaaaaaaaaacceeeeeeeeiiiiiiiioonnoooooooooooouuuuuuuuyyzz--'
)"/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
<a href="http://stph.crzt.fr">Stéphane Crozat</a>
<a href="http://www.gnu.org/licenses/gpl-3.0.txt">License GPL3.0</a>
Jun 14, 2015
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.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:param name="pOutputPath">/tmp</xsl:param>
<xsl:template match="bib">
<xsl:apply-templates select="ref"/>
<message>Output set to <xsl:value-of select="$pOutputPath"/></message>
</xsl:template>
<xsl:template match="ref">
<xsl:result-document href="file://{$pOutputPath}/{ref-id}.ref" encoding="UTF-8" method="xml" >
<sc:item>
<op:bib>
<op:bibM>
<sp:id><xsl:value-of select="ref-name"/></sp:id>
<sp:type>bib</sp:type>
<sp:desc>
<op:bibTxt>
<sc:para xml:space="preserve"><xsl:apply-templates select="*"/></sc:para>
</op:bibTxt>
</sp:desc>
</op:bibM>
</op:bib>
</sc:item>
</xsl:result-document>
</xsl:template>
<xsl:template match="structured-data | ref-id | ref-name"/>
<xsl:template match="authors">
<xsl:if test="text()!=''">
<sc:textLeaf role="auth">
<xsl:value-of select="."/>
</sc:textLeaf>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="title">
<xsl:if test="text()!=''">
<sc:textLeaf role="title">
<xsl:value-of select="."/>
</sc:textLeaf>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="edition">
<xsl:if test="text()!=''">
<sc:textLeaf role="ed">
<xsl:value-of select="."/>
</sc:textLeaf>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="year">
<xsl:if test="text()!=''">
<sc:textLeaf role="date">
<xsl:value-of select="."/>
</sc:textLeaf>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="url">
<xsl:if test="text()!=''">
<sc:uLink role="url" url="{.}">
<xsl:value-of select="."/>
</sc:uLink>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="*">
<xsl:if test="text()!=''">
<xsl:value-of select="."/>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
<a href="http://stph.crzt.fr">Stéphane Crozat</a>
<a href="http://www.gnu.org/licenses/gpl-3.0.txt">License GPL3.0</a>
Aug 31, 2015
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.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">
<xsl:param name="pOutputPath">/tmp</xsl:param>
<xsl:template name="section">
<xsl:param name="title"/>
<xsl:param name="type"/>
<sp:sec>
<of:section>
<of:sectionM>
<sp:title><xsl:value-of select="$title"/></sp:title>
</of:sectionM>
<sp:content>
<of:fragment>
<xsl:apply-templates select="ref[@type=$type]" mode="section">
<xsl:sort select="year" order="descending"/>
</xsl:apply-templates>
</of:fragment>
</sp:content>
</of:section>
</sp:sec>
</xsl:template>
<xsl:template match="bib">
<!-- Section -->
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<of:section xmlns:of="scpf.org:office" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<of:sectionM>
<sp:title>Bibliographie</sp:title>
</of:sectionM>
<!-- book -->
<xsl:call-template name="section">
<xsl:with-param name="title">Livres</xsl:with-param>
<xsl:with-param name="type">book</xsl:with-param>
</xsl:call-template>
<!-- bookSection -->
<xsl:call-template name="section">
<xsl:with-param name="title">Chapitres de livre</xsl:with-param>
<xsl:with-param name="type">bookSection</xsl:with-param>
</xsl:call-template>
<!-- journalArticle -->
<xsl:call-template name="section">
<xsl:with-param name="title">Articles de revues</xsl:with-param>
<xsl:with-param name="type">journalArticle</xsl:with-param>
</xsl:call-template>
<!-- conferencePaper -->
<xsl:call-template name="section">
<xsl:with-param name="title">Articles de conférence</xsl:with-param>
<xsl:with-param name="type">conferencePaper</xsl:with-param>
</xsl:call-template>
<!-- presentation -->
<xsl:call-template name="section">
<xsl:with-param name="title">Communications orales</xsl:with-param>
<xsl:with-param name="type">presentation</xsl:with-param>
</xsl:call-template>
<!-- presentation -->
<xsl:call-template name="section">
<xsl:with-param name="title">Mémoires</xsl:with-param>
<xsl:with-param name="type">thesis</xsl:with-param>
</xsl:call-template>
<!-- Autres -->
<sp:sec>
<of:section>
<of:sectionM>
<sp:title>Autres publications et communications</sp:title>
</of:sectionM>
<sp:content>
<of:fragment>
<xsl:apply-templates select="ref[not(@type)]
| ref[@type!='book'
and @type!='bookSection'
and @type!='journalArticle'
and @type!='conferencePaper'
and @type!='presentation'
]"
mode="section"></xsl:apply-templates>
</of:fragment>
</sp:content>
</of:section>
</sp:sec>
</of:section>
</sc:item>
<!-- Fragment -->
<xsl:apply-templates select="ref"/>
</xsl:template>
<xsl:template match="ref" mode="section">
<sp:frag sc:refUri="co/{ref-id}.fragment"/>
</xsl:template>
<xsl:template match="ref">
<xsl:result-document href="file://{$pOutputPath}/{ref-id}.fragment" encoding="UTF-8" method="xml" >
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<of:fragment xmlns:of="scpf.org:office" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<sp:info>
<of:block>
<of:blockM/>
<sp:co>
<of:flow>
<sp:txt>
<of:txt>
<sc:para xml:space="preserve"><xsl:apply-templates select="*"/></sc:para>
</of:txt>
</sp:txt>
</of:flow>
</sp:co>
</of:block>
</sp:info>
</of:fragment>
</sc:item>
</xsl:result-document>
</xsl:template>
<xsl:template match="structured-data | ref-id | ref-name"/>
<xsl:template match="title">
<xsl:if test="text()!=''">
<sc:inlineStyle role="emphasis">
<xsl:value-of select="."/>
</sc:inlineStyle>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="url">
<xsl:if test="text()!=''">
<sc:phrase role="url">
<of:urlM xmlns:of="scpf.org:office">
<sp:url xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"><xsl:value-of select="."/></sp:url>
</of:urlM>
<xsl:value-of select="."/>
</sc:phrase>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="*">
<xsl:if test="text()!=''">
<xsl:value-of select="."/>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
<a href="http://stph.crzt.fr">Stéphane Crozat</a>
<a href="http://www.gnu.org/licenses/gpl-3.0.txt">License GPL3.0</a>
Sep 03, 2015
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.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">
<xsl:param name="pOutputPath">/tmp</xsl:param>
<xsl:template match="bib">
<xsl:apply-templates select="ref"/>
<message>Output set to <xsl:value-of select="$pOutputPath"/></message>
</xsl:template>
<xsl:template match="ref">
<xsl:result-document href="file://{$pOutputPath}/{ref-id}.refs" encoding="UTF-8" method="xml" >
<sc:item>
<of:def>
<of:defM>
<sp:term><xsl:value-of select="ref-name"/></sp:term>
</of:defM>
<sp:def>
<of:sTxt>
<sc:para xml:space="preserve"><xsl:apply-templates select="*"/></sc:para>
</of:sTxt>
</sp:def>
</of:def>
</sc:item>
</xsl:result-document>
</xsl:template>
<xsl:template match="structured-data | ref-id | ref-name"/>
<xsl:template match="title">
<xsl:if test="text()!=''">
<sc:phrase role="special">
<xsl:value-of select="."/>
</sc:phrase>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="url">
<xsl:if test="text()!=''">
<sc:phrase role="url">
<of:urlM>
<sp:url><xsl:value-of select="."/></sp:url>
<sp:title><xsl:value-of select="../title"/></sp:title>
</of:urlM>
<xsl:value-of select="."/>
</sc:phrase>
<xsl:text>.</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="*">
<xsl:if test="text()!=''">
<xsl:value-of select="."/>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!--
<a href="http://stph.crzt.fr">Stéphane Crozat</a>
<a href="http://www.gnu.org/licenses/gpl-3.0.txt">License GPL3.0</a>
Aug 31, 2015
-->
<project basedir="." name="zoterotei2scenari">
<property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="xsl" location="${basedir}/xsl"/>
<property name="lib" location="${basedir}/lib"/>
<property name="log" location="${basedir}/log"/>
<delete dir="${tmp}" failonerror="false"/>
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<mkdir dir="${out}/zotero-optim-1"/>
<mkdir dir="${out}/zotero-optim-2"/>
<mkdir dir="${out}/zotero-opale"/>
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
<xslt classpath="${lib}/saxon9he.jar" basedir="${in}" includes="*.xml" destdir="${tmp}" extension=".xml" style="${xsl}/zoterotei2scbib.xsl"/>
<xslt classpath="${lib}/saxon9he.jar" basedir="${tmp}" destdir="${log}/optim1" extension=".xml" style="${xsl}/scbib2optim.xsl" failonerror="false">
<param name="pOutputPath" expression="${out}/zotero-optim-1"/>
</xslt>
<xslt classpath="${lib}/saxon9he.jar" basedir="${tmp}" destdir="${out}/zotero-optim-2" extension=".section" style="${xsl}/scbib2optim-fragment.xsl" failonerror="false">
<param name="pOutputPath" expression="${out}/zotero-optim-2/co"/>
</xslt>
<xslt classpath="${lib}/saxon9he.jar" basedir="${tmp}" destdir="${log}/opale" extension=".xml" style="${xsl}/scbib2opale.xsl" failonerror="false">
<param name="pOutputPath" expression="${out}/zotero-opale"/>
</xslt>
</project>
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