Commit 29e44dd7 authored by Aghiles's avatar Aghiles

gestion des métadonnées

parent 3ee23c7a
<?xml version="1.0" encoding="UTF-8"?>
<project name="wikiToHdoc" default="main" basedir="..">
<!-- wikipediaUrl and destination are the only required parameters -->
......@@ -21,6 +22,7 @@
<antcall target="clean"/>
<antcall target="prepare"/>
<antcall target="prepareHdocStructure"/>
<antcall target="getImgMetadata"/>
<antcall target="transformWikiToHdoc"/>
<antcall target="zip"/>
</target>
......@@ -75,7 +77,29 @@
</echoxml>
<xslt classpath="lib/saxon9he.jar" in="${tmpFolderPath}/containerTmp.xml" out="${tmpHdocResultFolderPath}/META-INF/container.xml" style="${xsltFolderPath}/addNamespaceToContainer.xsl"/>
</target>
<target name="getImgMetadata">
<!-- Preparing the links for the metadata extraction -->
<xslt classpath="lib/saxon9he.jar" in="${tmpFolderPath}/${filename}_prepared.xml" out="${hdocResultPath}/img_metadata_link.xml" style="${xsltFolderPath}/prepare_img_link_metadata.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xmlproperty file="${hdocResultPath}/img_metadata_link.xml" prefix="TEST"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/usr/share/java/lib/ant-contrib-version.jar"/>
</classpath>
</taskdef>
<for list="${TEST.images.image.link}" param="file">
<sequential>
<!-- <loadresource encoding="UTF-8" property="myURL">
<url url="@{file}"/>
</loadresource>
<echo file="${hdocResultPath}/@{file}/test.xml" encoding="UTF-8">${myURL}</echo> -->
<echo>@{file}</echo>
</sequential>
</for>
</target>
<target name="transformWikiToHdoc">
<!-- Applying wikipedia -> hdoc -->
<xslt classpath="lib/saxon9he.jar" in="${tmpFolderPath}/${filename}_prepared.xml" out="${hdocResultPath}/${filename}.html" style="${xsltFolderPath}/wiki_to_hdoc.xsl">
......
<?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">
<xsl:output encoding="UTF-8"/>
<xsl:template match="html">
<images>
<xsl:apply-templates select=".//a[img]"/>
</images>
</xsl:template>
<xsl:template match="a[img]">
<image>
<link>
<xsl:text>https://fr.wikipedia.org</xsl:text><xsl:value-of select="@href"/>
</link>
<ref>
<xsl:value-of select="./img/@src"/>
</ref>
</image>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
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