get_ressources_urls.xsl 1.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?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"
    xmlns:saxon="http://saxon.sf.net/" 
    extension-element-prefixes="saxon"
    >
    
      <!-- This XSL create an ANT script that will download our ressources (images) using the GET TASK-->
    
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
    
    <xsl:template match="/">
        <project name="getRessourcesFiles" basedir="." default="getRessourcesFiles">
         
            <target name="getRessourcesFiles">
18
                <xsl:apply-templates select="//img"/>
19 20 21 22 23 24 25
            </target>
        </project>
    </xsl:template>
    
    
    <xsl:template match="img" priority="5">
        <xsl:param name="dest-rep">${hdocResultPath}/ressources</xsl:param>
26 27
        <xsl:param name="dest-file">${hdocResultPath}/ressources/<xsl:value-of select="translate(tokenize(@src, '/')[last()],'?%','_')"/></xsl:param>
         <mkdir dir="{$dest-rep}"/>
28 29 30
        <get src="{@src}" dest="{$dest-file}" />
    </xsl:template>
    
31

32 33
    
</xsl:stylesheet>