Commit 25090cee authored by lhommeni's avatar lhommeni

Utilisation du nouveau hdoc_to_opale avec correction des erreurs concernant les paths

parent 34a045b3
......@@ -22,10 +22,9 @@
<ant antfile="${antFolderPath}/wiki_to_hdoc.ant"/>
<!-- Then hdoc to opale (important to set the new basedir in order to make it work) -->
<ant antfile="${basedir}/hdoc_to_opale/hdoc_to_opale.ant" dir="${basedir}/hdoc_to_opale">
<property name="InputPath" value="${hdocResultPath}/${filename}.hdoc"/>
<property name="OutputPath" value="${hdocResultPath}/${filename}.scar"/>
<property name="OutputPathDivided" value="${hdocResultPath}/${filename}_divided.scar"/>
<ant antfile="${basedir}/hdoc_to_opale/myantce.ant" dir="${basedir}/hdoc_to_opale">
<property name="in" value="${hdocResultPath}"/>
<property name="out" value="${hdocResultPath}"/>
</ant>
</target>
</project>
\ No newline at end of file
......@@ -21,10 +21,9 @@
<ant antfile="${antFolderPath}/wiki_to_hdoc_fetcher.ant"/>
<!-- Then hdoc to opale (important to set the new basedir in order to make it work) -->
<ant antfile="${basedir}/hdoc_to_opale/hdoc_to_opale.ant" dir="${basedir}/hdoc_to_opale">
<property name="InputPath" value="${hdocResultPath}/${filename}.hdoc"/>
<property name="OutputPath" value="${hdocResultPath}/${filename}.scar"/>
<property name="OutputPathDivided" value="${hdocResultPath}/${filename}_divided.scar"/>
<ant antfile="${basedir}/hdoc_to_opale/myantce.ant" dir="${basedir}/hdoc_to_opale">
<property name="in" value="${hdocResultPath}"/>
<property name="out" value="${hdocResultPath}"/>
</ant>
</target>
</project>
\ No newline at end of file
......@@ -69,22 +69,7 @@
<value>application/vnd.oasis.opendocument.graphics </value>
<value>application/vnd.oasis.opendocument.spreadsheet</value>
<value>application/pdf</value>
<!-- xml -->
<value>application/xml</value>
<!-- .java -->
<value>text/x-java-source</value>
<!-- .cpp et .c -->
<value>text/x-c</value>
<!-- .py -->
<value>text/x-script.phyton</value>
<!-- .js -->
<value>application/x-javascript</value>
<!-- .html -->
<value>text/html</value>
<!-- .css -->
<value>text/css</value>
<!-- json -->
<value>application/json</value>
<value>text/x-listing</value>
</choice>
</attribute>
</define>
......
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" ?>
<wspType defaultCode="Opale" title="Opale Advanced 3.5 (fr-FR)" description="" uri="Opale3-5_fr-FR_005" key="Opale3-5" lang="fr-FR" version="3.5.005"><wspUpdate localAutoUpdate="minor"><res key="Opale3-5.wsp"/></wspUpdate><systemSpace space="~param/Opale3-5/ss"><res key="Opale3-5.ss"/></systemSpace><systemSpace space="~param/Opale3-5/bs" optional="true"><res key="Opale3-5.bs"/></systemSpace><systemSpace space="~param/Opale3-5/gen/web"><res key="Opale3-5.gen.web"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMono"><res key="Opale3-5.gen.scormMono"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMulti"><res key="Opale3-5.gen.scormMulti"/></systemSpace><systemSpace space="~param/Opale3-5/gen/paper"><res key="Opale3-5.gen.paper"/></systemSpace><systemSpace space="~param/Opale3-5/gen/pres"><res key="Opale3-5.gen.pres"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresShort"><res key="Opale3-5.gen.previewPresShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresStandard"><res key="Opale3-5.gen.previewPresStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandard"><res key="Opale3-5.gen.previewWebStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShort"><res key="Opale3-5.gen.previewWebShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandardComments"><res key="Opale3-5.gen.previewWebStandardComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShortComments"><res key="Opale3-5.gen.previewWebShortComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm12"><res key="Opale3-5.gen.packScorm12"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm2k4"><res key="Opale3-5.gen.packScorm2k4"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packClaroline"><res key="Opale3-5.gen.packClaroline"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packGanesha"><res key="Opale3-5.gen.packGanesha"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packMoodle"><res key="Opale3-5.gen.packMoodle"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packSyfadis"><res key="Opale3-5.gen.packSyfadis"/></systemSpace><editionSheet pack="Opale3-5_fr-FR_005" brickSelector="{Opale3-5.moz;3.5.005;fr-FR}"/></wspType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<wspType defaultCode="Opale" title="Opale Advanced 3.5 (fr-FR)" description="" uri="Opale3-5_fr-FR_005" key="Opale3-5" lang="fr-FR" version="3.5.005"><wspUpdate localAutoUpdate="minor"><res key="Opale3-5.wsp"/></wspUpdate><systemSpace space="~param/Opale3-5/ss"><res key="Opale3-5.ss"/></systemSpace><systemSpace space="~param/Opale3-5/bs" optional="true"><res key="Opale3-5.bs"/></systemSpace><systemSpace space="~param/Opale3-5/gen/web"><res key="Opale3-5.gen.web"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMono"><res key="Opale3-5.gen.scormMono"/></systemSpace><systemSpace space="~param/Opale3-5/gen/scormMulti"><res key="Opale3-5.gen.scormMulti"/></systemSpace><systemSpace space="~param/Opale3-5/gen/paper"><res key="Opale3-5.gen.paper"/></systemSpace><systemSpace space="~param/Opale3-5/gen/pres"><res key="Opale3-5.gen.pres"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresShort"><res key="Opale3-5.gen.previewPresShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewPresStandard"><res key="Opale3-5.gen.previewPresStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandard"><res key="Opale3-5.gen.previewWebStandard"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShort"><res key="Opale3-5.gen.previewWebShort"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebStandardComments"><res key="Opale3-5.gen.previewWebStandardComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/previewWebShortComments"><res key="Opale3-5.gen.previewWebShortComments"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm12"><res key="Opale3-5.gen.packScorm12"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packScorm2k4"><res key="Opale3-5.gen.packScorm2k4"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packClaroline"><res key="Opale3-5.gen.packClaroline"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packGanesha"><res key="Opale3-5.gen.packGanesha"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packMoodle"><res key="Opale3-5.gen.packMoodle"/></systemSpace><systemSpace space="~param/Opale3-5/gen/packSyfadis"><res key="Opale3-5.gen.packSyfadis"/></systemSpace><editionSheet pack="Opale3-5_fr-FR_005" brickSelector="{Opale3-5.moz;3.5.005;fr-FR}"/></wspType>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="main" default="convert">
<property name="InputPath" value="bib2.bib"></property>
<property name="OutputPath" value="${basedir}\result\ref.scar"></property>
<target name="convert">
<antcall target="preparation"/>
<antcall target="BibtexToBibXml"/>
<antcall target="BibXmlToHdocBib"/>
<antcall target="HdocToOpale"/>
<antcall target="zip"/>
<antcall target="CleanDirectory"/>
</target>
<target name="convertfrombibxml">
<antcall target="preparation"/>
<antcall target="HdocToOpale"/>
<antcall target="zip"/>
<antcall target="CleanDirectory"/>
</target>
<target name="preparation">
<delete dir="${basedir}/result"></delete>
<mkdir dir="${basedir}/result"></mkdir>
<mkdir dir="${basedir}/decompressedOpale"></mkdir>
<mkdir dir="${basedir}/decompressedOpale/ref"></mkdir>
<mkdir dir="${basedir}/tmp"></mkdir>
</target>
<target name="CleanDirectory">
<delete dir="${basedir}/tmp"></delete>
<delete dir="${basedir}/java"></delete>
<delete dir="${basedir}/decompressedOpale"></delete>
</target>
<target name="BibtexToBibXml">
<!-- Convert Bibtex into BibtexXml -->
<java
fork="true"
failonerror="true"
jar="lib/bibtex.jar"
>
<arg value="${InputPath}"/>
<arg value="${basedir}/tmp"/>
<arg value="/tmpBibXml.xml"/>
</java>
</target>
<target name="BibXmlToHdocBib">
<!-- Convert from BibXlm to HdocBib -->
<xslt classpath="${basedir}/lib/saxon9he.jar"
in="${basedir}\tmp\tmpBibXml.xml" out="${basedir}\tmp\tmpHdocBib.xml"
xslresource="${basedir}/XSL/BibToHdoc.xsl"></xslt>
</target>
<target name="HdocToOpale">
<!-- Convert from HdocBib to Opale -->
<xslt in="${basedir}\tmp\tmpHdocBib.xml"
out="${basedir}/tmp/tempHdoc.xml"
xslresource="${basedir}/XSL/SeparateXmlt.xsl">
<param name="in" expression="${basedir}\tmp\tmpHdocBib.xml"></param>
<param name="out" expression="${basedir}\decompressedOpale\ref"></param>
</xslt>
<ant antfile="${basedir}/tmp/tempHdoc.xml"/>
</target>
<target name="zip">
<chmod dir="${basedir}/decompressedOpale" perm="777"></chmod>
<copy file=".wspmeta" todir="${basedir}/decompressedOpale"/>
<zip basedir="decompressedOpale" destfile="${OutputPath}" encoding="UTF-8"/>
<chmod dir="${OutputPath}" perm="777"/>
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- This sheet replaces the url of a namespace where needed -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:oldmods="http://bibtexml.sf.net/"
xmlns:myns="http://www.utc.fr/ics/hdoc/bibtexXm">
<xsl:template match="node()|@*" priority="3">
<xsl:copy>
<xsl:apply-templates select="node()|@*">
</xsl:apply-templates></xsl:copy>
</xsl:template>
<xsl:template match="
oldmods:file | oldmods:entry |
oldmods:entry/oldmods:article | oldmods:entry/oldmods:book | oldmods:entry/oldmods:booklet | oldmods:entry/oldmods:conference |
oldmods:entry/oldmods:manual | oldmods:entry/oldmods:techreport | oldmods:entry/oldmods:mastersthesis |
oldmods:entry/oldmods:phdthesis | oldmods:entry/oldmods:inbook | oldmods:entry/oldmods:incollection |
oldmods:entry/oldmods:proceedings | oldmods:entry/oldmods:unpublished | oldmods:entry/oldmods:misc |
oldmods:article/oldmods:title | oldmods:article/oldmods:author | oldmods:article/oldmods:journal |
oldmods:article/oldmods:volume | oldmods:article/oldmods:number | oldmods:article/oldmods:pages |
oldmods:book/oldmods:author | oldmods:book/oldmods:editor | oldmods:book/oldmods:title |
oldmods:book/oldmods:publisher | oldmods:book/oldmods:volume | oldmods:book/oldmods:number |
oldmods:book/oldmods:series | oldmods:book/oldmods:address | oldmods:book/oldmods:edition |
oldmods:booklet/oldmods:title | oldmods:booklet/oldmods:author | oldmods:booklet/oldmods:howpublished |
oldmods:booklet/oldmods:address | oldmods:booklet/oldmods:key | oldmods:booklet/oldmods:howpublished |
oldmods:book/oldmods:adress | oldmods:book/oldmods:month | oldmods:book/oldmods:year |
oldmods:inbook/oldmods:chapter | oldmods:inbook/oldmods:pages | oldmods:inbook/oldmods:publisher |
oldmods:inbook/oldmods:series | oldmods:inbook/oldmods:type | oldmods:inbook/oldmods:address |
oldmods:inbook/oldmods:edition |
oldmods:manual/oldmods:title | oldmods:manual/oldmods:author | oldmods:manual/oldmods:editor | oldmods:manual/oldmods:volume |
oldmods:manual/oldmods:number | oldmods:manual/oldmods:series | oldmods:manual/oldmods:pages | oldmods:manual/oldmods:organization |
oldmods:manual/oldmods:address | oldmods:manual/oldmods:edition | oldmods:manual/oldmods:key |
oldmods:techreport/oldmods:author | oldmods:techreport/oldmods:title | oldmods:techreport/oldmods:institution |
oldmods:techreport/oldmods:type | oldmods:techreport/oldmods:number | oldmods:techreport/oldmods:address |
oldmods:techreport/oldmods:key |
oldmods:mastersthesis/oldmods:author | oldmods:mastersthesis/oldmods:title |
oldmods:mastersthesis/oldmods:school | oldmods:mastersthesis/oldmods:year | oldmods:mastersthesis/oldmods:type |
oldmods:mastersthesis/oldmods:address | oldmods:mastersthesis/oldmods:key |
oldmods:phdthesis/oldmods:author | oldmods:phdthesis/oldmods:title |
oldmods:phdthesis/oldmods:school | oldmods:phdthesis/oldmods:year | oldmods:phdthesis/oldmods:type |
oldmods:phdthesis/oldmods:address | oldmods:phdthesis/oldmods:key |
oldmods:inbook/oldmods:author | oldmods:inbook/oldmods:editor | oldmods:inbook/oldmods:title |
oldmods:inbook/oldmods:chapter | oldmods:inbook/oldmods:pages | oldmods:inbook/oldmods:publisher |
oldmods:inbook/oldmods:volume | oldmods:inbook/oldmods:number | oldmods:inbook/oldmods:series |
oldmods:inbook/oldmods:type | oldmods:inbook/oldmods:address | oldmods:inbook/oldmods:edition | oldmods:inbook/oldmods:key |
oldmods:incollection/oldmods:author | oldmods:incollection/oldmods:title | oldmods:incollection/oldmods:booktitle |
oldmods:incollection/oldmods:publisher | oldmods:incollection/oldmods:editor | oldmods:incollection/oldmods:volume |
oldmods:incollection/oldmods:number | oldmods:incollection/oldmods:series | oldmods:incollection/oldmods:type |
oldmods:incollection/oldmods:chapter | oldmods:incollection/oldmods:pages | oldmods:incollection/oldmods:address |
oldmods:incollection/oldmods:edition | oldmods:incollection/oldmods:key |
oldmods:proceedings/oldmods:title | oldmods:proceedings/oldmods:year | oldmods:proceedings/oldmods:editor |
oldmods:proceedings/oldmods:volume | oldmods:proceedings/oldmods:number | oldmods:proceedings/oldmods:series |
oldmods:proceedings/oldmods:address | oldmods:proceedings/oldmods:publisher | oldmods:proceedings/oldmods:organization |
oldmods:proceedings/oldmods:key |
oldmods:unpublished/oldmods:author | oldmods:unpublished/oldmods:title | oldmods:unpublished/oldmods:howpublished |
oldmods:unpublished/oldmods:key |
oldmods:misc/oldmods:author | oldmods:misc/oldmods:title | oldmods:misc/oldmods:howpublished |
oldmods:misc/oldmods:key |
oldmods:conference/oldmods:author | oldmods:conference/oldmods:title | oldmods:conference/oldmods:booktitle |
oldmods:conference/oldmods:editor | oldmods:conference/oldmods:volume | oldmods:conference/oldmods:number |
oldmods:conference/oldmods:series | oldmods:conference/oldmods:pages | oldmods:conference/oldmods:address |
oldmods:conference/oldmods:organization | oldmods:conference/oldmods:publisher | oldmods:conference/oldmods:key |
oldmods:inproceedings/oldmods:author | oldmods:inproceedings/oldmods:title | oldmods:inproceedings/oldmods:booktitle |
oldmods:inproceedings/oldmods:editor | oldmods:inproceedings/oldmods:volume | oldmods:inproceedings/oldmods:number |
oldmods:inproceedings/oldmods:series | oldmods:inproceedings/oldmods:pages | oldmods:inproceedings/oldmods:address |
oldmods:inproceedings/oldmods:organization | oldmods:inproceedings/oldmods:publisher | oldmods:inproceedings/oldmods:key |
*/oldmods:month | */oldmods:year | */oldmods:url" priority="5">
<xsl:element name="myns:{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
<xsl:template match="*" priority="4">
<xsl:element name="myns:note">
<xsl:attribute name="type_of"><xsl:value-of select="local-name()"></xsl:value-of></xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="oldmods:metadata"></xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:bib="http://www.utc.fr/ics/hdoc/bibtexXm"
xmlns:op="utc.fr:ics/opale3">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:param name="Position"/>
<xsl:template match="bib:file">
<xsl:for-each select="bib:entry">
<xsl:if test="position()=$Position">
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<op:bib xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:op="utc.fr:ics/opale3">
<op:bibM>
<sp:id xmlns="http://www.utc.fr/ics/scenari/v3/primitive"><xsl:value-of select="@id"></xsl:value-of></sp:id>
<xsl:if test="child::node()/bib:url = true()"> <sp:type>web</sp:type> </xsl:if>
<xsl:if test="child::node()/bib:url = false()"> <sp:type>bib</sp:type></xsl:if>
<sp:desc>
<op:bibTxt>
<sc:para xml:space="preserve">
<xsl:apply-templates select="child::node()/bib:author"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:year"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:title"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:booktitle"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:editor"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:publisher"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:address"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:edition"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:url"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:journal"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:series"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:volume"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:number"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:chapter"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:pages"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:type"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:institution"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:organization"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:howpulished"></xsl:apply-templates>
<xsl:apply-templates select="child::node()/bib:note"></xsl:apply-templates>
</sc:para>
</op:bibTxt>
</sp:desc>
</op:bibM>
</op:bib>
</sc:item>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="bib:editor | bib:publisher">
<sc:textLeaf role="ed" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><xsl:value-of select="."/>
<xsl:text> </xsl:text></sc:textLeaf>
</xsl:template>
<xsl:template match="bib:editor[last()] | bib:publisher[last()]">
<sc:textLeaf role="ed" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:value-of select="."/>
</sc:textLeaf>
</xsl:template>
<xsl:template match="bib:author">
<sc:textLeaf role="auth" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:value-of select="."/> <xsl:text> </xsl:text>
</sc:textLeaf>
</xsl:template>
<xsl:template match="bib:author[last()]">
<sc:textLeaf role="auth" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:value-of select="."/>
</sc:textLeaf>
</xsl:template>
<xsl:template match="bib:year">
<sc:textLeaf role="date" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><xsl:value-of select="../bib:month"/> <xsl:text> </xsl:text><xsl:value-of select="."/></sc:textLeaf>
</xsl:template>
<xsl:template match="bib:title | bib:booktitle">
<sc:textLeaf role="title" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:value-of select="."/>
</sc:textLeaf>
</xsl:template>
<xsl:template match="bib:url">
<sc:uLink role="url" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<xsl:attribute name="url"> <xsl:value-of select="."/></xsl:attribute>
<xsl:value-of select="."/>
</sc:uLink>
</xsl:template>
<xsl:template match="bib:volume | bib:number">
Volume : <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:chapter">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:series">
Series : <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:edition">
Edition : <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:address">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:journal">
Journal : <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:pages">
Pages : <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:type">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:institution">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:organization">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:howpublished">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="bib:note">
Note : <xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:bib="http://www.utc.fr/ics/hdoc/bibtexXm"
xmlns:op="utc.fr:ics/opale3">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:param name="in"/>
<xsl:param name="out"/>
<xsl:template match="bib:file">
<project basedir=".." name="ref">
<xsl:apply-templates select="bib:entry"></xsl:apply-templates>
</project>
</xsl:template>
<xsl:template match="bib:entry">
<xslt xslresource="./XSL/OneBibXMLToOpaleXml.xsl">
<xsl:attribute name="in"><xsl:value-of select="$in"/></xsl:attribute>
<xsl:attribute name="out"><xsl:value-of select="$out"/>/<xsl:value-of select="./@id"/>.ref</xsl:attribute>
<param name="Position">
<xsl:attribute name="expression"><xsl:value-of select="count(preceding-sibling::bib:entry) + 1"/></xsl:attribute>
</param>
</xslt>
</xsl:template>
<xsl:template match="dc:metadata" xmlns:dc="http://purl.org/dc/elements/1.1/">
</xsl:template>
</xsl:stylesheet>
@article{article,
author = {Peter Adams},
title = {The title of the work},
journal = {The name of the journal},
year = 1993,
number = 2,
pages = {201-213},
month = 7,
note = {An optional note},
volume = 4
}
@book{book,
author = {Peter Babington},
title = {The title of the work},
publisher = {The name of the publisher},
year = 1993,
volume = 4,
series = 10,
address = {The address},
edition = 3,
month = 7,
note = {An optional note},
isbn = {3257227892}
}
@booklet{booklet,
title = {The title of the work},
author = {Peter Caxton},
howpublished = {How it was published},
address = {The address of the publisher},
month = 7,
year = 1993,
note = {An optional note}
}
@conference{conference,
author = {Peter Draper},
title = {The title of the work},
booktitle = {The title of the book},
year = 1993,
editor = {The editor},
volume = 4,
series = 5,
pages = 213,
address = {The address of the publisher},
month = 7,
organization = {The organization},
publisher = {The publisher},
note = {An optional note}
}
@inbook{inbook,
author = {Peter Eston},
title = {The title of the work},
chapter = 8,
pages = {201-213},
publisher = {The name of the publisher},
year = 1993,
volume = 4,
series = 5,
address = {The address of the publisher},
edition = 3,
month = 7,
note = {An optional note}
}
@incollection{incollection,
author = {Peter Farindon},
title = {The title of the work},
booktitle = {The title of the book},
publisher = {The name of the publisher},
year = 1993,
editor = {The editor},
volume = 4,
series = 5,
chapter = 8,
pages = {201-213},
address = {The address of the publisher},
edition = 3,
month = 7,
note = {An optional note}
}
@manual{manual,
title = {The title of the work},
author = {Peter Gainsford},
organization = {The organization},
address = {The address of the publisher},
edition = 3,
month = 7,
year = 1993,
note = {An optional note}
}
@mastersthesis{mastersthesis,
author = {Peter Harwood},
title = {The title of the work},
school = {The school where the thesis was written},
year = 1993,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}
@misc{misc,
author = {Peter Isley},
title = {The title of the work},
howpublished = {How it was published},
month = 7,
year = 1993,
note = {An optional note}
}
@phdthesis{phdthesis,
author = {Peter Joslin},
title = {The title of the work},
school = {The school where the thesis was written},
year = 1993,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}
@proceedings{proceedings,
title = {The title of the work},
year = 1993,
editor = {Peter Kidwelly},
volume = 4,
series = 5,
address = {The address of the publisher},
month = 7,
organization = {The organization},
publisher = {The name of the publisher},
note = {An optional note}
}
@techreport{techreport,
author = {Peter Lambert},
title = {The title of the work},
institution = {The institution that published},
year = 1993,
number = 2,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}
@unpublished{unpublished,
author = {Peter Marcheford},
title = {The title of the work},
note = {An optional note},
month = 7,
year = 1993
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
<mkdir dir="${tmpdir}"/>
<antcall target="UnzipHdocFile"/>
<antcall target="validateInput" />
<antcall target="ValidateInput" />
<antcall target="FindContentFiles"/>
<ant antfile="${tmpdir}/generateContentPath.xml"/>
......@@ -51,7 +51,7 @@
<xslt
in="${toString:first}"
out="${tmpdir}/generateContentPath.xml"
style="transformation0.xsl"
style="xsl/transformation0.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<chmod file="${tmpdir}/generateContentPath.xml" perm="777"/>
......@@ -69,11 +69,14 @@
<copy todir="${tmpdir}/decompressedOpaleDivided/res" >
<fileset dir="${tmpdir}/decompressedOpale/res" includes="**"/>
</copy>
<copy todir="${tmpdir}/decompressedOpaleDivided/references" >
<fileset dir="${tmpdir}/decompressedOpale/references" includes="**"/>
</copy>
<zip basedir="${tmpdir}/decompressedOpaleDivided" destfile="${OutputPathDivided}" encoding="UTF-8"/>
</target>
<!-- Validating the XML container file -->
<target name="validateInput">
<target name="ValidateInput">
<jing file="${tmpdir}/decompressedHdoc/META-INF/container.xml" rngfile="schema/hdoc1-container.rng"></jing>
</target>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="hdoc_to_opale" basedir="." default="convert">
<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"/>
<property name="schema" location="${basedir}/schema"/>
<property name="bibtex" location="${basedir}/bibtex_to_opale"/>
<property file="global.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="lib/jing.jar"/>
</classpath>
</taskdef>
<target name="convert">
<!-- This is the main target : it is called whether by the project (as the default target) or by the user/converter
website, if specified in the command line. Basically, this target consists in several targets/ant buildfiles calls. -->
<antcall target="CleanDirectory"/>
<mkdir dir="${tmp}"/>
<antcall target="UnzipHdocFile"/>
<antcall target="ValidateInput" />
<antcall target="FindContentFiles"/>
<ant antfile="${tmp}/generateContentPath.xml"/>
<antcall target="ValidateOutput"/>
<antcall target="DivideOutput"/>
<antcall target="ZipOutput"/>
<antcall target="ZipDividedOutput"/>
<antcall target="CleanDirectory"/>
</target>
<target name="CleanDirectory">
<delete dir="${tmp}"/>
</target>
<target name="UnzipHdocFile">
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
refers to the hdoc file furthermore in this project. -->
<unzip dest="${tmp}/decompressedHdoc">
<fileset dir="${in}">
<include name="**/*.hdoc"/>
</fileset>
</unzip>
<chmod dir="${tmp}/decompressedHdoc" perm="777"/>
</target>
<target name="FindContentFiles">
<!-- Finds the absolute path of container.xml and applies transformation0.xsl on it.-->
<first id="first">
<fileset dir="${tmp}/decompressedHdoc/META-INF" includes="**/container.xml"/>
</first>
<xslt in="${toString:first}" out="${tmp}/generateContentPath.xml" style="${xsl}/transformation0.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison" />
<chmod file="${tmp}/generateContentPath.xml" perm="777"/>
</target>
<target name="ZipOutput">
<copy file="${bibtex}/.wspmeta" todir="${tmp}/decompressedOpale"/>
<mkdir dir="${tmp}/decompressedOpale/res"/>
<ant antfile="${tmp}/moveRessourceFiles.xml"/>
<zip basedir="${tmp}/decompressedOpale" destfile="${out}/output.scar" encoding="UTF-8"/>
</target>
<target name="ZipDividedOutput">
<copy file="${bibtex}/.wspmeta" todir="${tmp}/decompressedOpaleDivided"/>